Home Forums General XMetaL Discussion List of XM processing instructions Reply To: List of XM processing instructions

mag3737

Reply to: List of XM processing instructions

GotoNext(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]

Reply

Products
Downloads
Support