Home > SOA Tips > XML Developer > Understanding and using XPath
SOA Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

XML DEVELOPER

Understanding and using XPath


Ed Tittel
12.31.2003
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



XML Developer Tip
(Receive this column in your inbox,
click Edit your Profile to subscribe.)

Understanding and using XPath
Ed Tittel

In some of these tips, I occasionally review XML books, usually because they offer real value to XML developers and content creators. Here I go again in that same vein, this time for Steven Holzner's recently released book XPath Kick Start: Navigating XML with XPath 1.0 and 2.0, SAMS Publishing, Copyright 2004 (released December, 2003), ISBN: 0672324113; List Price $34.99. As one of the best writers on XML around, I've mentioned other Holzner books on general XML and XSLT in previous tips. This time, Holzner not only brings his extensive knowledge and experience to bear, he also includes lots of explanations for and examples of XPath, and how it relates to XSLT, XQuery, XPointer, XLink and the Document Object Model (DOM) level 3.

In a tight nutshell, XPath defines mechanisms whereby one XML document can reference and access contents of other XML documents. As the name of the specification indicates, XPath provides various methods to navigate a tree-structured representation of an XML document once it's been parsed and internalized within some kind of XML document handling tool or program. But XPath also permits document values to be identified, tested against predicates (logical constructs that test for specific values, instances, types of values, and so on), and extracted on demand. Thus it's not just a syntax to find one's way around XML documents; it's also a tool for testing and extracting values from such documents. As such, it's a key element in any XML developer's toolkit, given constant needs to locate, open, examine, and extract information from such documents.

Holzner not only covers the XPath 1.0 and 2.0 specifications and syntax, he also explains:

  • how to use XPath and XSLT to transform XML document values
  • how to use XPath in XSLT to match patterns in documents of interest
  • how to exploit XPath's capabilities to their fullest

Along the way, you'll find explanations and examples (with running code available online: visit www.samspublishing.com/kickstart/, then follow links to the XPath book and its download links*). The best part of these examples is that they not only illustrate XPath and related XML syntax, they also include references to external specs, namespaces, and other documents necessary to make this code work. As somebody who's had to learn other XML applications through trial and error with this all-important "supporting information," I see this as a real boon to those trying to experiment with and learn about such applications.

Definitely worth a look; check it out online*, or at your favorite bookstore!

*As I write this in late December, SAMS hasn't yet posted downloads or the online data for this book. But according to sources at Pearson (SAMS' parent company), this material should be available in early January.


About the Author

Ed Tittel is a VP of Content Development & Delivery at CapStar LLC, an e-learning company based in Princeton, NJ. Ed runs a small team of content developers and project managers in Austin, TX, and writes regularly on XML and related vocabularies and applications. E-mail Ed at etittel@lanw.com.


For More Information:

  • Looking for free research? Browse our comprehensive White Papers section by topic, author or keyword.
  • Are you tired of technospeak? The Web Services Advisor column uses plain talk and avoids the hype.
  • For insightful opinion and commentary from today's industry leaders, read our Guest Commentary columns.
  • Hey Codeheads! Start benefiting from these time-saving XML Developer Tips and .NET Developer Tips.

  • Visit our huge Best Web Links for Web Services collection for the freshest editor-selected resources.
  • Visit Ask the Experts for answers to your Web services, SOAP, WSDL, XML, .NET, Java and EAI questions.
  • Choking on the alphabet soup of industry acronyms? Visit our helpful Glossary for the latest industry lingo.
  • Couldn't attend one of our Webcasts? Don't miss out. Visit our archive to watch at your own convenience.
  • Discuss this article, voice your opinion or talk with your peers in the SearchWebServices Discussion Forums.

Rate this Tip
To rate tips, you must be a member of SearchSOA.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
XML and XML schema
What's the future of XML?
SOA pattern of the week (#7): policy centralization
Try XML-based Extensible Business Reporting Language (XBRL) for accounting reports
What's new at the W3C
Ganymede: Modeling tools target SOA, UML
Data services mashups emerge for SOA
Making sense of data services mashups
XML turns 10
SOA helps save 100-year-old business
Oracle maps heterogeneous data services strategy for SOA

XML
National Weather Service policy supports XML
XML and democracy at work: The Election Markup Language (EML)
For interesting interface access, check out Xamlon
Royalty-free, revolutionary UBL
Altova strikes again with MapForce 2005
Beating the RSS crunch with aggregation/bloglines
Voice, speech, SIP, and XML: ECMA-269
Microsoft Baseline Security Analyzer and XML
An open source, native XML database: dbXML 2.0
Second-generation XML security preview: SAML

XML Developer
Use the soapUI software tool to tame WSDL
WSDL 2.0, new messaging for Web services
Using RELAX NG For data integration
Efficient XML Interchange tackles data verbosity
XML to DDL imports, synchronizes database schemata
The basics of MathML 3.0
Migrating to XSLT 2.0
What's up with XML 2.0?
Say hello to XPath 2.0
Podcasting software covers many bases

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
class diagram  (SearchSOA.com)
Fast Infoset (FI)  (SearchSOA.com)
GeoRSS  (SearchSOA.com)
Keyhole Markup Language  (SearchSOA.com)
RELAX NG  (SearchSOA.com)
state diagram  (SearchSOA.com)
Universal Business Language  (SearchSOA.com)
Vector Markup Language  (SearchSOA.com)
XML infoset  (SearchSOA.com)
XML pipeline  (SearchSOA.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SOA Trends and Strategy - SOA Education, SOA Development, SOA Implementations
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts