XPath
XPath is the W3C query language for addressing parts of an XML document — paths like /Document/CstmrCdtTrfInitn/PmtInf, predicates, and functions used in testing, extraction, transformation, and validation.
Reading an expression
An XPath is a location path: absolute from the root (/a/b/c) or relative (//a finds a anywhere). Predicates filter — //Entry[Amt > 1000] picks entries over a thousand; position predicates like [1] and last() select by order. The @ axis selects attributes, and functions (count, contains, sum, normalize-space) compute over node sets.
Namespace handling trips everyone up: ISO 20022 messages live in a default namespace, so elements must be addressed with a bound prefix or namespace-agnostic matching — which is why a live tester that shows matches instantly beats guessing.
Where it is used
XPath is embedded in XSLT transformations, Schematron business-rule checks, test assertions on XML payloads, and ad-hoc data extraction from payment files and manifests. Our tester evaluates XPath 1.0 expressions against any pasted XML live.
Related Standards
- •XPath 1.0 — W3C recommendation
- •XSLT / Schematron — the languages XPath plugs into
Free Tools & Resources
Need help with this?
We consult and build across all of these domains — tell us what you are working on.
