Trying to define multi-level enumeration restrictions
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Tue Nov 01, 2005 12:47 am
Trying to define multi-level enumeration restrictions
Hi all,
I have XML as follows:
<FieldConfig Group="MAIN" FieldName="OrderNumber"/>
<FieldConfig Group="MAIN" FieldName="Customer"/>
<FieldConfig Group="MAIN" FieldName="Address"/>
<FieldConfig Group="DETAIL" FieldName="Customer"/>
<FieldConfig Group="DETAIL" FieldName="JobDesc"/>
etc.
What I want to do is restrict the FieldName attribute to a different set of values for each possible Group value.
For example, valid Group values are: MAIN, DETAIL, PAYMENT.
In Group MAIN, valid FieldName values are OrderNumber, Customer, Address, Phone.
In Group DETAIL, valid FieldName values are Customer, StartDate, JobDesc.
What is the best way to set up the restrictions in the XSD? Thanks in advance,
Vernon
I have XML as follows:
<FieldConfig Group="MAIN" FieldName="OrderNumber"/>
<FieldConfig Group="MAIN" FieldName="Customer"/>
<FieldConfig Group="MAIN" FieldName="Address"/>
<FieldConfig Group="DETAIL" FieldName="Customer"/>
<FieldConfig Group="DETAIL" FieldName="JobDesc"/>
etc.
What I want to do is restrict the FieldName attribute to a different set of values for each possible Group value.
For example, valid Group values are: MAIN, DETAIL, PAYMENT.
In Group MAIN, valid FieldName values are OrderNumber, Customer, Address, Phone.
In Group DETAIL, valid FieldName values are Customer, StartDate, JobDesc.
What is the best way to set up the restrictions in the XSD? Thanks in advance,
Vernon
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Vernon,
These are called co-occurance constraints and are not supported by XML Schema. You have as options:
* enforce them at application level
* use XML Schema with Schematron embedded rules (oXygen supports this and you can even validate against both the XML Schema and the Schematron rules in one action).
* use Relax NG schemas
Best Regards,
George
These are called co-occurance constraints and are not supported by XML Schema. You have as options:
* enforce them at application level
* use XML Schema with Schematron embedded rules (oXygen supports this and you can even validate against both the XML Schema and the Schematron rules in one action).
* use Relax NG schemas
Best Regards,
George
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