Summary

The initial examples of reading and displaying XML data all relied on the dynamic updating of the innerText property of HTML tags. Therefore, your first sample code dealt solely with that. From this, you learned how to read the data using a simple array of nodes. This process works as long as all the nodes are at the same level. Since it's an array, you can easily add more data nodes to the XML file by using larger subscripts on the array and adding more HTML tags as the targets for the data.

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.