Home › Forums › General XMetaL Discussion › List of XM processing instructions › Reply To: List of XM processing instructions
Reply to: List of XM processing instructions
February 13, 2009 at 1:04 amGotoNext(0) does match replace-text PIs in my testing, but there's a better way to remove them all. The problem with GotoNext() is that I couldn't see an obvious way to write a loop that would terminate.
Here's what I would do instead:
[code]
//XMetaL Script Language JScript:
var nodes = ActiveDocument.getNodesByXPath(“//processing-instruction('xm-replace_text')”);
while (nodes.length > 0) {
myparent = nodes.item(0).parentNode;
myparent.removeChild(nodes.item(0));
}
[/code]