For a particular node, I have an xml string stored in the database and it doesn’t have an ID attribute.
e.g. <H1 xmlns="http://www.w3.org/1999/xhtml">Sample text here.</H1>
I’m wondering how I could either create a DOM node or get the DOM node object based on this xml string.
Once I find this node, I need to manipulate it (hide it, etc.). I can’t use DOMParser() to convert it into an object, since it just creates a stand along XMLDocument object.
Any ideas ?
To create a new DOM node in the target document, call adoptNode to adopt the created node from the document created by DOMParser to the target one.
If you just want to find the node in a document, you’ll have to walk the DOM tree and call isEqualNode on each node.