Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

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

The XPath Data Model

XPath 1.0 views an XML document as a tree of nodes. This tree is very similar to a Document Object Model (DOM) tree, so if you’re familiar with the DOM, you should have some understanding of how to build basic XPath expressions. (To be precise, this is a conceptual tree; an XSLT processor or anything else that implements the XPath standard doesn’t have to build an actual tree.)

[2.0] XPath 2.0 views everything as a sequence. A sequence can contain all of the nodes we cover here as well as atomic values. Whenever we’re working with parsed data from an XML document, the sequences we’re using are most likely nodes from the document tree, so we won’t have to worry about atomic values. For now, just be aware that the underlying data model in XPath 2.0 is different; we’ll cover those differences in great detail later in this chapter.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint