XPath - Introduction
As you know, XML was created to be a self-describing markup format. As XML matured, new XML related creations were popping up. Although you could create a nicely structured document with XML, there didn't seem to be an easy way to find information inside the document.
XML documents can be thought of as a Tree Structure, made up of parent, child, and sibling relationships. Because of this very logical layout of an XML document it seems like there should be a standard way to find information.
XPath - Finding Information
XPath is the solution to finding information in an XML document. XPath uses expressions to find elements, attributes, and other information in your XML. If you have an XML document that contained a bunch of your favorite books, each with author children elements, you can use a one line XPath expression to find all the authors of your favorite books!
If you are thinking seriously about learning XML and its important related technologies, XPath is one area you can't pass up!
XPath - Used in XSLT
The most common place people might see XPath expressions are in XSLT (Extensible Stylesheet Language Transformation). We will be teaching XSLT after we have taught you the steppingstone knowledge of XPath.
XPointer and XQuery are both new XML-related technologies that extend or borrow from XPath. XPath truly is a keystone for XML related learning!
XPath - Required Knowledge
Before you start our XPath tutorial, you should have a strong understanding of XML. If you skipped the XML Tutorial, now would be a good time to read it!
Download Tizag.com's XML Book
If you would rather download the PDF of this tutorial, check out our
XML eBook from the Tizag.com store. Found Something Wrong in this Lesson?Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time! |