Top "Xpath" questions

The primary purpose of XPath is to address parts of an XML document.

XSLT getting last element

I am trying to find the last element in my xml, which looks like: <list> <element name="…

xslt xpath menu
How can I find the link URL by link text with XPath?

I have a well formed XHTML page. I want to find the destination URL of a link when I have …

xml xhtml xpath
Is there an XSLT name-of element?

In XSLT there is the <xsl:value-of select="expression"/> to get the value of an element, but is …

xml xslt xpath
XPath query to get nth instance of an element

There is an HTML file (whose contents I do not control) that has several input elements all with the same …

xml xpath
How to use "not" in xpath?

I want to write something of the sort: //a[not contains(@id, 'xx')] (meaning all the links that there 'id' …

dom xpath xpathquery
How to select specified node within Xpath node sets by index with Selenium?

I'm writing a Selenium testcase. And here's the xpath expression I use to match all 'Modify' buttons within a data …

xpath selenium
XPath to return only elements containing the text, and not its parents

In this xml, I want to match, the element containing 'match' (random2 element) <root> <random1> <…

xml xpath
Get nodes where child node contains an attribute

Suppose I have the following XML: <book category="CLASSICS"> <title lang="it">Purgatorio</title> &…

xml xpath
How to use regex in XPath "contains" function

I would like to match the following text sometext12345_text using the below regex. I'm using this in one of …

regex xpath selenium-webdriver contains
XPath to select multiple tags

Given this simplified data format: <a> <b> <c>C1</c> <d&…

xml xpath