In Practice
XPath is a powerful language for traversing tree structures. As a part of this, it needs a basic data processing capability in the form of numerical and Boolean expressions, and the function library, to express complex predicate requirements. However, those capabilities are not really powerful enough for most “real” data processing needs. You cannot find the largest or smallest number in a node set, only the sum of the numbers in a node set. You cannot compute sines and cosines or square roots, and you cannot find all <point x="..." y="..." /> elements corresponding to points within a complex shape.
If possible, use XPath only to find the data you wish to process from your input document, and be sure the application using XPath is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access