Top "Xpath" questions

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

Using XPath, How do I select a node based on its text content and value of an attribute?

Given this XML: <DocText> <WithQuads> <Page pageNumber="3"> <Word> July <Quad> &…

xml xpath xquery
Getting element's name in XPATH

If I selected an element using XPATH how can I get its name? I mean something like text() function in //…

xpath elementname
how to ignore namespaces with XPath

My goal is to extract certain nodes from multiple xml files with multiple namespaces using XPath. Everything works fine as …

xml xpath namespaces xml-namespaces
How to select a node's first child name? XPath

I have an XML from which I have to select the name of the child of one of the nodes. …

xpath children
How to select a node using XPath if sibling node has a specific value?

I have the following document: <a> <bb>abc</bb> <cc>ccc</…

xml xpath
XSL if else condition

I have a requirement where I'd like to have if else statement to check whether a node has attributes or …

xml xslt xpath
How to query XML using namespaces in Java with XPath?

When my XML looks like this (no xmlns) then I can easly query it with XPath like /workbook/sheets/sheet[1] &…

java xml xpath xml-namespaces
XPath: How to check if an attribute exists?

Given the following XML, how do I write an XPath query to pull nodes where the attribute foo exists?: <…

xml xpath
How do I select only visible elements using XPath?

I have a GWT application for which I'm trying to write some tests using Selenium. I'm using XPath to identify …

gwt xpath selenium
How to extract xml attribute using Python ElementTree

For: <foo> <bar key="value">text</bar> </foo> How do I get "…

python xml xpath elementtree