Entry
How do I use the method processingInstructions?
How do I use the method processingInstructions?
Apr 16th, 2005 02:49
Martin Honnen,
The method processingInstructions takes one optional argument, the name
of processing instructions to look for, and returns an XMLList with all
the matching processing instruction child nodes of all XML objects in
the XMLList the method is called on.
If no argument is passed in then the wild card name '*' to match all
processing instructions is used.
Here are some examples:
XML.ignoreProcessingInstructions = false;
var xmlList = <>
<god>
<?process Kibology="on"?>
<name>Kibo</name>
</god>
<god>
<?pi value="Xibo"?>
<name>Xibo</name>
</god>
</>;
alert(xmlList.processingInstructions().length()); // shows 2
alert(xmlList.processingInstructions('process').length()); // shows 1
alert(xmlList.processingInstructions('whatever').length()); // shows 0