Using Button Clicks to Move Through the <Catalog> Database

Listing 9.7 is a modification of the previous HTML listing. This program will read all of the child nodes of the <Book> nodes at all levels.

Listing 9.7 Reading All Child Nodes of the <Book> Nodes
 1:<HTML> 2:<HEAD> 3:<SCRIPT LANGUAGE="JavaScript"> 4:<!-- 5: // This identifier is used to force the XML processor to 6:// parse the file. 7: var RootElement1; 8:// This is the XML object. 9: var xmlDoc1=new ActiveXObject("microsoft.xmldom"); 10:// This is the global pointer to a node that is used to 11:// move around the <Book> objects. It always stores the 12:// current <Book> object. 13: var globalHoldNode; 14:// This is a global pointer that points to the last 15:// <Book> node. 16: var ...

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.