The ALL Operator

In some ways, the ALL operator (*) is the least useful of the set extraction operators. As the name implies, it does no filtering, simply returning every node in the given location. Used as the last item in the list, it simply makes explicit what the default operation would be.

Go back to Listing 16.3 and modify the GrabNodes() function to match Listing 16.10. Change the line that loads the XML file so that it now loads listing 14-4.xml, the <Catalog> database.

Listing 16.10 Using the Default for Node Selection
 1: function GrabNodes() 2: { 3: var NodeData=DataSource1.selectNodes("Catalog/Book"); 4: moveNode=NodeData.nextNode(); 5: while(moveNode!=null) 6: { 7: document.write(moveNode.text+"<BR>"); 8: moveNode=NodeData.nextNode(); ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.