How to use <all> in a <group>?
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 1
- Joined: Fri Aug 19, 2005 5:49 pm
How to use <all> in a <group>?
Hi,
I'm using Oxygen 5.1. I want to create a group in my schema and I hate using <sequence> so I want to use <all>. Here is what I thought I wanted but I'm doing something wrong. It seems that somewhere I must specify minOccurs = maxOccurs = 1 but I can't find the right place for that. Below is the part of the schema and below that is the error I get. Can anyone help?
Thanks a lot
Marc
<xs:group name="yearly_amounts_totals_group">
<xs:all >
<!-- #5 -->
<xs:element name="obligations_total" type="xs:decimal"/>
<!-- #6 (#5 minus #3) -->
<xs:element name="adjusted_ygi" type="xs:decimal"/>
<!-- #7 (percentage from dividing income by combined income) -->
<xs:element name="share_gross_income" type="xs:decimal"/>
</xs:all>
</xs:group>
Error:
SystemID: /Users/mrespass/Developer/_MJS/DHHS/dhhs.xsd
Location: 110:54
Description: E cos-all-limited.1.2: An 'all' model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition.
URL: http://www.w3.org/TR/xmlschema-1/#cos-all-limited
I'm using Oxygen 5.1. I want to create a group in my schema and I hate using <sequence> so I want to use <all>. Here is what I thought I wanted but I'm doing something wrong. It seems that somewhere I must specify minOccurs = maxOccurs = 1 but I can't find the right place for that. Below is the part of the schema and below that is the error I get. Can anyone help?
Thanks a lot
Marc
<xs:group name="yearly_amounts_totals_group">
<xs:all >
<!-- #5 -->
<xs:element name="obligations_total" type="xs:decimal"/>
<!-- #6 (#5 minus #3) -->
<xs:element name="adjusted_ygi" type="xs:decimal"/>
<!-- #7 (percentage from dividing income by combined income) -->
<xs:element name="share_gross_income" type="xs:decimal"/>
</xs:all>
</xs:group>
Error:
SystemID: /Users/mrespass/Developer/_MJS/DHHS/dhhs.xsd
Location: 110:54
Description: E cos-all-limited.1.2: An 'all' model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition.
URL: http://www.w3.org/TR/xmlschema-1/#cos-all-limited
-
- Posts: 20
- Joined: Sat Nov 26, 2005 5:17 pm
- Location: Houston, Texas, USA
- Contact:
So ... what's the right answer?george wrote:Hi,
The problem is not in the code you posted but in the part that makes a reference to the group.
Best Regards,
George
Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
To find the declaration causing the error all the references to the yearly_amounts_totals_group group should be available. For example the following reference to the group violates the part of the XML Schema spec pointed by the clickable URL (the book icon) available in the Info column of the Errors view table (only in the <oXygen/> standalone distribution):
In this example removing the xs:sequence tag and placing the xs:group reference directly in the xs:complexType makes the element definition valid.
Regards,
Sorin
To find the declaration causing the error all the references to the yearly_amounts_totals_group group should be available. For example the following reference to the group violates the part of the XML Schema spec pointed by the clickable URL (the book icon) available in the Info column of the Errors view table (only in the <oXygen/> standalone distribution):
Code: Select all
<xs:element name="e">
<xs:complexType>
<xs:sequence>
<xs:group ref="yearly_amounts_totals_group"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Regards,
Sorin
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