XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 30
- Joined: Wed Feb 14, 2018 3:27 pm
XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Post by mariomueller »
Hi all,
the following expression works only in XPATH 2.0
Is there any workaroud to do this in XPATH 1.0?
Thanks
Regards
Mario
the following expression works only in XPATH 2.0
Code: Select all
/ABC/XYZ/text()=('9','293','305','332')
Thanks
Regards
Mario
-
- Posts: 30
- Joined: Wed Feb 14, 2018 3:27 pm
Re: XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Post by mariomueller »
I got it:
/ABC/XYZ/text()=('9'or '293' or'305' or '332')
/ABC/XYZ/text()=('9'or '293' or'305' or '332')
-
- Posts: 30
- Joined: Wed Feb 14, 2018 3:27 pm
Re: XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Post by mariomueller »
Sorry, that does not work.
The expression with the ORs does always return true, although the value in the XML is totally different.
Could anybody please help?
Regards
Mario
The expression with the ORs does always return true, although the value in the XML is totally different.
Could anybody please help?
Regards
Mario
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Hi,
Maybe this StackOverflow post will help:
https://stackoverflow.com/questions/481 ... -of-values
Regards,
Radu
Maybe this StackOverflow post will help:
https://stackoverflow.com/questions/481 ... -of-values
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 30
- Joined: Wed Feb 14, 2018 3:27 pm
Re: XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Post by mariomueller »
Hi Radu,
thanks for the hint.
The XPATH has no syntax error and works with XPATH1.0 :
But - asuming the value in the XML would be X293X, the expression return true although 293 is not X293X
It is just a contains, not an equals
Any other ideas?
Regards
Mario
thanks for the hint.
The XPATH has no syntax error and works with XPATH1.0 :
Code: Select all
contains(/M_UTILMD/G_SG2/S_NAD[D_3035='MS']/C_C082/D_3055/text(), '293')
It is just a contains, not an equals

Any other ideas?
Regards
Mario
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XPATH 1.0 workaround for /ABC/XYZ/text()=('9','293','305','332')
Hi Mario,
Right, that's why that post on StackOverflow suggested adding those spaces between the tokens in the string, to avoid such cases.
Regards,
Radu
Right, that's why that post on StackOverflow suggested adding those spaces between the tokens in the string, to avoid such cases.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service