How to use <all> in a <group>?
Posted: Fri Aug 19, 2005 5:52 pm
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