Chapter 16. Parsing XML with the DOM

 

The DOM very rarely makes sense, especially when it comes to namespaces. If you want to retain your sanity, avoid it.

 
 --Michael Kay

It simply isn’t possible to write a book about XML while avoiding the DOM, or Document Object Model. The truth is that the DOM won’t lead you down the path to insanity, although I can certainly respect Mr. Kay’s opinion since I’ve struggled with the DOM myself from time to time. For this reason, you shouldn’t think of the DOM as the end-all tool to XML processing for the Web. It’s just one of many tools that you should have in your XML development arsenal, ready to engage when needed. This hour explores the DOM and the basics of how it is used. In doing so, you learn how it provides ...

Get Sams Teach Yourself XML in 24 Hours, Third Edition 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.