XML .xsd Schema - Enforce Relationship
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Sun Sep 14, 2014 1:17 pm
XML .xsd Schema - Enforce Relationship
I have the following xml which I validate with an .xsd schema.
I can enforce that each of the product names in xProfile exists and is defined in the first half of the xml by using ref and key ref.
I would like to enforce that each 'xProduct' contains an entry for each of the products defined in the top half of the xml but don't know how to do this or if this is possible?
I can enforce that each of the product names in xProfile exists and is defined in the first half of the xml by using ref and key ref.
I would like to enforce that each 'xProduct' contains an entry for each of the products defined in the top half of the xml but don't know how to do this or if this is possible?
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="\\schema.xsd">
<products>
<product name="product01" bool_setting="true">
<code name="AAA"/>
<code name="BBB"/>
</product>
<product name="product02" bool_setting="true">
<code name="CCC"/>
<code name="DDD"/>
</product>
<product name="product03" bool_setting="true">
<code name="EEE"/>
</product>
<product name="product04" bool_setting="false">
<code name="FFF"/>
<code name="GGG"/>
</product>
<product name="product05" bool_setting="false">
<code name="HHH"/>
</product>
<product name="product06" bool_setting="false">
<code name="III"/>
</product>
</products>
<xProfile name="name_one">
<products>
<product name="product01" aNumber="1"/>
<product name="product02" aNumber="1"/>
<product name="product03" aNumber="1"/>
<product name="product04" aNumber="1"/>
<product name="product05" aNumber="1"/>
<product name="product06" aNumber="1"/>
</products>
</xProfile>
<xProfile name="name_one">
<products>
<product name="product01" aNumber="1"/>
<product name="product02" aNumber="1"/>
<product name="product03" aNumber="1"/>
<product name="product04" aNumber="1"/>
<product name="product05" aNumber="1"/>
<product name="product06" aNumber="1"/>
</products>
</xProfile>
</profiles>
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