Home > Positioning > Subjects > XPath (XML Path Language)

XPath (XML Path Language)

XPath (the XML Path Language) is a language for navigating and selecting within tree-structured documents: you write a location path — a sequence of steps from a starting node — and it returns the nodes that match. It began as the addressing core shared by two other languages, and grew into a full query language for trees.

The organising idea is the location path: navigation expressed as steps along axes. /catalog/book/title reads like a file path, but the model beneath is richer — each step chooses an axis (which direction to move: child, descendant, ancestor, parent, sibling, attribute, self…), a node test (which nodes to keep), and optional predicates (conditions). XPath turns “where in this structure” into a precise, composable expression.

Origin

XPath was defined by the W3C in 1999, with James Clark as editor, to serve two specifications at once: XSLT (transforming XML) and XPointer (addressing into XML). XPath 1.0 (1999) is still the most widely deployed; 2.0 (2007) realigned it onto a sequence-based data model shared with XQuery, and 3.0 (2014) / 3.1 (2017) extended it further — the arc from a compact path syntax to a full, typed query language.

Pages

Persons

Sources


See also: James Clark · URI · Domain-Specific Languages