Please explain XPATH "Require XML element in XSD when another element has certain value?"
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 30
- Joined: Wed Feb 14, 2018 3:27 pm
Please explain XPATH "Require XML element in XSD when another element has certain value?"
Post by mariomueller »
Hi all,
on https://stackoverflow.com/questions/370 ... tain-value
I found an example for
"Require XML element in XSD when another element has certain value?"
In the solution is the XPATH:
Could anybody please explain this? Why gets IBAN mandatory when TYPE = 'INTERNATIONAL'?
Many thanks
Regards
Mario
on https://stackoverflow.com/questions/370 ... tain-value
I found an example for
"Require XML element in XSD when another element has certain value?"
In the solution is the XPATH:
Code: Select all
<xs:assert test="not(TYPE = 'INTERNATIONAL') or IBAN"/>
Many thanks
Regards
Mario
-
- Posts: 30
- Joined: Wed Feb 14, 2018 3:27 pm
Re: Please explain XPATH "Require XML element in XSD when another element has certain value?"
Post by mariomueller »
Hi,
i got it. OR is logical OR. Means: At least one expression must be true
When TYPE = 'INTERNATIONAL' the left side is false. So the right side 'IBAN' must be true.
<xs:assert test="not(TYPE = 'INTERNATIONAL') or IBAN"/>
Regards Mario
i got it. OR is logical OR. Means: At least one expression must be true
When TYPE = 'INTERNATIONAL' the left side is false. So the right side 'IBAN' must be true.
<xs:assert test="not(TYPE = 'INTERNATIONAL') or IBAN"/>
Regards Mario
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Please explain XPATH "Require XML element in XSD when another element has certain value?"
Hello,
Yes, the assert condition is satisfied even if the type is not 'INTERNATIONAL', or if the type is 'INTERNATIONAL' and you have an 'IBAN' element.
Best Regards,
Octavian
Yes, the assert condition is satisfied even if the type is not 'INTERNATIONAL', or if the type is 'INTERNATIONAL' and you have an 'IBAN' element.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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