August 2000
Beginner
456 pages
9h 24m
English
In all of your queries so far, you've used the selectNodes() method to perform the extraction. There is another method that can be used, and it's known as the selectSingleNode() method. The only difference between it and the selectNodes() method is that it only returns the first node that satisfies the selection criteria. Of course, if no nodes satisfy the criteria, the result is the empty set.
Go back to the HTML file and modify the GrabNodes() function to match the following:
function GrabNodes() { var NodeData=DataSource1.selectSingleNode("Catalog/Book"); document.write(NodeData.text); /* moveNode=NodeData.nextNode(); while(moveNode!=null) { document.write(moveNode.text+"<BR>"); moveNode=NodeData.nextNode(); ...Read now
Unlock full access