How does php modify the xml element name?

Source: Internet
Author: User
How to modify the xml element name in php $ v = "abc ";
$ Note "-> item (0)-> getElementsByTagName (" name ")-> item (0)-> nodeName = $ v; // change the name to $ v, but the nodeName is read-only.
Is there any modification method, such as xml element attributes or values that can be modified, but the name cannot be modified?


Reply to discussion (solution)

Insert a new node to delete the old node.


But there are many byte points in the original label. how can I get the content and insert it into the new node?
Similar to JavaScript in html, you can obtain the content of all nodes.
Value = oldnode. innerHTML;
Newnode. innerHTML = value;
Is there any similar method?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.