• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. XML and XSLT > Parsing XML Documents in Code

Parsing XML Documents in Code

We’ve seen how to access an individual element in an XML document now, so let’s take the next step—parsing (that is, reading and interpreting) an entire XML document at once.

To do that, I’ll create a new example, which will display the whole structure of an XML document. In this case, I’ll name the function that parses the document parse. You pass a node to this function, and it will navigate through all of that node’s contained nodes automatically. To parse the entire document, then, you just pass the document element to parse like this, where we’re working on our XML document, 22-01.xml:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint