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>?

Post by mrespass » Fri Aug 19, 2005 5:52 pm


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

<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"/>

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.

Site Admin
Posts: 2101
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Wed Aug 31, 2005 11:26 am


The problem is not in the code you posted but in the part that makes a reference to the group.

Best Regards,

Posts: 20
Joined: Sat Nov 26, 2005 5:17 pm
Location: Houston, Texas, USA

Post by jsb » Sat Dec 03, 2005 5:33 am

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,
So ... what's the right answer?

Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model

Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Mon Dec 05, 2005 6:33 pm


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:group ref="yearly_amounts_totals_group"/>
In this example removing the xs:sequence tag and placing the xs:group reference directly in the xs:complexType makes the element definition valid.


Post Reply