Discussion:
Deleting a processing instruction
(too old to reply)
frameexpert
2006-10-20 14:01:47 UTC
Permalink
I have an element that contains a processing instruction:

<Title>This is the<?FM MARKER [Cross-Ref] b410106?> Title
element</Title>

I can find the processing instruction by using:

oPi = oTitle.selectSingleNode("processing-instruction()");

How do I delete the processing instruction, now that I have located it?
Thanks in advance.

Rick Quatro
Martin Honnen
2006-10-20 14:08:17 UTC
Permalink
Post by frameexpert
oPi = oTitle.selectSingleNode("processing-instruction()");
How do I delete the processing instruction, now that I have located it?
The same way you delete any node with the DOM
node.parentNode.removeChild(node)
e.g.
oPi.parentNode.removeChild(oPi)
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...