A pure XPath 1.0 — one-liner:
Use:
count(/*/group/user[not(. = ../following-sibling::group/user)])
More Related Contents:
- How does XPath deal with XML namespaces?
- How to parse XML in Bash?
- XPath contains(text(),’some string’) doesn’t work when used with node with more than one Text subnode
- Is there a way to learn xpath without using firebug or xpath as firefox is not supporting the addons?
- Current node vs. Context node in XSLT/XPath?
- XPath to select element based on childs child value
- XPath select all elements between two specific elements
- XPath – Difference between node() and text()
- How to pass variable parameter into XPath expression?
- How to use XPath contains() here?
- Using XPATH to search text containing
- XPath select node with namespace
- How to read large xml file without loading it in memory and using XElement
- Extract value of attribute node via XPath
- How to declare XPath namespaces in xmlstarlet?
- How do you output the current element path in XSLT?
- What is the XPath to select a range of nodes?
- Navigating XML nodes in VBScript, for a Dummy
- What is the difference between // and .// in XPath?
- How to select a node using XPath if sibling node has a specific value?
- xmllint failing to properly query with xpath without namespaces
- How to retrieve namespaces in XML files using Xpath
- Difference between “//” and “/” in XPath?
- How to insert a new element under another with xmlstarlet?
- What is the difference between root node, root element and document element in XML?
- XPath on an XML document with namespace
- What is the difference between name() and local-name()?
- Is it possible to apply normalize-space to all nodes XPath expression finds?
- How can I use xpath querying using R’s XML library?
- XSLT – How to keep only wanted elements from XML