One correct answer is:
/a/b/*[self::c or self::d or self::e]
Do note that this
a/b/*[local-name()='c' or local-name()='d' or local-name()='e']
is both too-long and incorrect. This XPath expression will select nodes like:
OhMy:c
NotWanted:d
QuiteDifferent:e
More Related Contents:
- How to execute XPath one-liners from shell?
- XPath query to get nth instance of an element
- Getting attribute using XPath
- xmllint failing to properly query with xpath
- case-insensitive matching in XPath?
- Xml Namespace breaking my xpath!
- XPath to select Element by attribute value
- How can I use XPath to find the minimum value of an attribute in a set of elements?
- XPath with multiple conditions
- XPath: Get parent node from child node
- Is there an XSLT name-of element?
- Get Nth child of a node using xpath
- How to find the max attribute from an XML document using Xpath 1.0
- How to select a node using XPath if sibling node has a specific value?
- Get nodes where child node contains an attribute
- XSLT Replace function not found
- How do you identify duplicate values in a numerical sequence using XPath 2.0?
- What is the difference between ‘or’ and ‘|’ when programming in xslt?
- What is the correct XPath for choosing attributes that contain “foo”?
- Using XPath, How do I select a node based on its text content and value of an attribute?
- XPath to get all child nodes (elements, comments, and text) without parent
- How to apply the XPath function ‘substring-after’
- XPath to return only elements containing the text, and not its parents
- distinct in Xpath?
- How can I select an element with multiple classes with Xpath?
- WiX Installer: using xslt with heat.exe to update attributes
- 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