XPath
XPath is a language for navigating and selecting nodes in structured documents, especially XML documents.
BDD in Action, Second Edition
An XPath expression is a path query that selects nodes in a structured document such as an HTML or XML document.
- How it is used
- Locates HTML elements for WebDriver acceptance tests when their position, attributes, or text provide the useful identifier.
- How deep it goes
- Explains common expressions through WebDriver calls and element examples, without developing XPath beyond the patterns needed for page interaction.
- Examples
- Uses destination titles and prices, a welcome heading, and registration preference labels as selection targets.
- What you can do after
- Apply it via WebDriver `By.xpath()` to find elements by attributes or text and navigate to related elements.
Event Processing in Action
A language for selecting and addressing parts of an XML document.
- How it is used
- Uses XPath to express event header and payload filters at an input terminal.
- How deep it goes
- Explains paths, filter expressions, and result-type success conditions using a conceptual XML representation of event attributes.
- Examples
- Uses location paths, ranking comparisons, and combined credit-or-ranking tests to illustrate expressions.
- What you can do after
- Evaluate and understand XPath filters by interpreting paths, comparisons, and result-type success conditions.
Practical Automation with PowerShell: Effective scripting from the console to the cloud
An XPath query is an expression defined by the XPath language for selecting nodes in an XML or HTML document tree.
- How it is used
- Extracts Microsoft Update Catalog search and detail-page data during PowerShell web scraping.
- How deep it goes
- Demonstrates browser-assisted query design, SelectNodes, SelectSingleNode, and nested-element traversal without teaching XPath language syntax broadly.
- Examples
- Uses Microsoft Update Catalog KB4521858 results, dynamic link ids, architecture, supported products, and supersedence links.
- What you can do after
- Apply it via PowerHTML to select result links and detail-page values from converted HTML.
100 SQL Server Mistakes and How to Avoid Them
XPath is a W3C language for navigating and selecting nodes in an XML document.
- How it is used
- Navigates XML hierarchies to select rows and map parent values during SQL Server OPENXML() shredding.
- How deep it goes
- Defines navigation, row selection, and ../ traversal but stops short of broader XPath syntax.
- Examples
- Uses nested employee, contract, and skill XML with upward ../ mappings.
- What you can do after
- Apply it via OPENXML() to select XML rows and retrieve values from higher hierarchy levels.
Read how 100 SQL Server Mistakes and How to Avoid Them explains XPath →
Related concepts
- xmluses · XML (Extensible Markup Language) is a text-based markup language for representing structured information using elements, attributes, and nested relationships.
- CSSalternative to · CSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- JSONPathcontrasts with · JSONPath is a query language for selecting and extracting values from JSON data.
- Page Element Query Languagealternative to · The Page Element Query Language is Serenity/JS's portable query syntax for locating page elements and deriving information from them.
- CSS selectoralternative to · A CSS selector is a pattern that matches elements in a document according to their names, attributes, relationships, states, or other conditions.
Questions about XPath
What is XPath?
XPath is a language for navigating and selecting nodes in structured documents, especially XML documents.
Which Manning books explain XPath?
BDD in Action, Second Edition, Event Processing in Action, Practical Automation with PowerShell: Effective scripting from the console to the cloud and 100 SQL Server Mistakes and How to Avoid Them.
What is the difference between XPath and CSS?
XPath is a language for navigating and selecting nodes in structured documents, especially XML documents. CSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



