I have to parse an XML document that looks like this:
This is FAQ (but I'm lazy to search duplicates today)
In XPath 1.0
//*[local-name()='name']
Selects any element with "name" as local-name.
In XPath 2.0 you can use:
//*:name
Use:
/*/*/*/*/*
[local-name()='REPORT_DATA'
or
local-name()='REPORT_HEADER'
]
Anyone care for more complete syntax?
String xPathExpression = "/*[local-name()='OASISReport]
/*[local-name()='MessagePayload]
/*[local-name()='RTO]
/*[local-name()='REPORT_ITEM]
/*[local-name()='REPORT_DATA"];
Btw, if the XPath also requires the element index position:
String xPathExpression = "/*[local-name()='OASISReport][1]