I have variable documents that I need to change on the fly. For example, I could have a document as follows:
<item> <tag1></tag1> </item> <tag2> <item></item> <item></item> </tag2>
This is very simplified, but I have tags with the same name at different levels. I want to get element tags in tag2. The actual tags in the files that I give have unique identifiers to distinguish them, as well as some other attributes. I need to find the tag, comment it out and save the xml. I was able to get a DOMDocument to return a "tag2" node, but I'm not sure how to access the element tags inside this structure.
source share