XML technologies / XML / Python & XML / Querying XML with XPath
(Excerpt from "Python & XML" by Christopher A. Jones & Fred L. Drake, Jr.)
The XML Path Language (XPath) is a language that lets you search XML documents using a path-like string. An XPath query returns individual nodes or sets of nodes based on expressions. XPath does not use XML syntax. Indeed, it is not a procedural programming language in the usual sense: there is no concept of control flow. XPath expressions are usually individual strings. XPath does support a certain functional style of processing, commonly found in programming languages, but you do not write XPath scripts or programs. Instead, you write XPath expressions, which are evaluated against XML documents and produce lists of nodes that are then returned. This section explains the origins of XPath, its syntax and capabilities, and how it is used in Python.
Copyright © 2002 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "Python & XML" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top