XPath TutorialLesson 46Free preview
XPath Introduction
This lesson is part of XML · All levels
Summary
XPath is an expression language for selecting the XML document portion based on a path pattern, e.g. /store/book[1]/title. Because selection is expressed in one expression, the search becomes much more concise than manual repetition. XPath became the basis of XSLT, XQuery, and many XML parser in different languages.
Key points
- XPath specifies the path of selection for the document node
- The absolute path begins with / and is relative to //
- Predicate in square brackets filtered based on condition
- The result of an expression is a node-set, string, number, or boolean
- XPath is used for XSLT, XQuery, and DOM Level 3 XPath
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.