Home arrow XML arrow XPath Basics

XPath Basics

One of the fundamental constructs for XSL transformations and XML links, XPath is nonetheless one of the lesser lights of the XML universe. However, if you're serious about developing your XML skills, you need to know it inside out - and this tutorial has all you need to get started.

  1. XPath Basics
  2. Dog Days
  3. First Steps
  4. Revolving Around An Axis
  5. Proof Of The Pudding
  6. Playing Chicken
  7. Operating With Extreme Caution
  8. Be Cool
  9. The Next Step
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 6
August 15, 2001

print this article


It's strange but true - even if you've been working with XML for a while, it's quite likely that you've never heard of XPath prior to today. And even if you have, it's probably been in the context of another technology - XSLT or XPointer - with your experience with XPath itself limited to a cursory examination.

Now, that's a shame, because XPath is not only pretty interesting, but it forms an important component of both XML stylesheet tranformations (XSLT) and the XPointer linking language. By providing XML developers with a standard method of addressing any part of an XML document, XPath is a small yet very important piece of the whole XML jigsaw. XSLT uses it extensively to match nodes in an XML source tree, while XPointer uses it in combination with XLink to identify specific locations in an XML document.

My point? Very simple - if you're at all serious about XML, you need to understand XPath. And over the course of this tutorial, I'm going to assist you in this endeavour by explaining the fundamentals of the XPath data model, together with some examples of XPath's more complex expressions and functions.

Before we get going, though, a few disclaimers:

First, I don't claim to be an expert on XPath. Much of the material in this tutorial is based on my own experience as a developer, or gleaned from late-night email conversations over beer and stale pizza. In other words - caveat emptor!

Second, as new XML standards are proposed and disposed, the material here may become invalid; you should always refer to the most current standard or recommendation for up-to-date information (links to everything you need are included at the end of the article.) This tutorial is based on the W3C's XPath 1.0 recommendation.

Now that I have that off my chest - let's get started!

This article copyright Melonfire 2001. All rights reserved.

>>> More XML Articles          >>> More By Vikram Vaswani, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Google Docs and Xpath Data Functions
- Flex Array Collection Sort and Filtering
- The Flex Tree Control
- Flex List Controls
- Working with Flex and Datagrids
- How to Set Up Podcasting and Vodcasting
- Creating an RSS Reader Application
- Building an RSS File
- An Introduction to XUL Part 6
- An Introduction to XUL Part 5
- An Introduction to XUL Part 4
- An Introduction to XUL Part 3
- An Introduction to XUL Part 2
- An Introduction to XUL Part 1
- XML Matters: Practical XML Data Design and M...

Developer Shed Affiliates


Dev Shed Tutorial Topics: