magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2001 > 04 > XML@Large  

Trailblazing with XPath

By Michael Floyd

When he was young, my brother Greg was into motorcross. He received his first motorcycle, a Yamaha 125, when he was just 13. He subsequently rode that bike in the legendary Barstow to Las Vegas race featured in the movie, "On Any Sunday." Anxious to show me the rigors of the course, he one day insisted that I accompany him on an enduro ride. We drove through the Mojave Desert and by evening found a dry lake where we set up camp. The next morning, we unloaded our motocross bikes and were off like a shot. I spent half the day riding, and he spent the other half picking me up off the desert floor.

As the sun began to set, we focused our attention on returning to camp. The problem was, everything in the desert looked the same. "Which way is camp?" I asked. Somehow, Greg spotted a path we'd crossed earlier in the day and we found our camp about an hour after dark. Greg had an amazing internal compass that always showed him the way home.

As in desert enduro, finding your way through XML documents isn't always a straightforward task. Fortunately, the designers of XML have included a mechanism, called XPath, that helps you navigate through documents. XPath partly defines a syntax that lets you easily traverse a tree's structure and select one or more of its nodes. Once you've selected a node or nodes, you can manipulate, reorder, or transform them in any way you desire. The mechanism that lets you select tree nodes is called a pattern. A pattern is actually a limited form of what XPath calls location paths. (We'll get to location paths in a moment.)

Much of XPath's expression language was originally described in the early XSL specification.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2