[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: RE: "minOccurs", "maxOccurs" attribute not allowed error
From: "David Remy" <dremy () bea ! com>
Date: 2004-02-15 2:23:19
Message-ID: 4B2B4C417991364996F035E1EE39E2E1085139 () uskiex01 ! amer ! bea ! com
[Download RAW message or body]
it looks like this schema is not ok. i looked over at the schema spec \
(http://www.w3.org/TR/xmlschema-1/#declare-namedModelGroup) and found this:
-------
Also note that in the first (named) case above no reference is made to minOccurs or \
maxOccurs: this is because the schema for schemas does not allow them on the child of \
<group> when it is named. This in turn is because the {min occurs} and {max occurs} \
of the particles which refer to the definition are what count.
-------
which says that you cannot have a minOccurs or maxOccurs on the child of a named \
group.
in schema for schema it looks like minOccurs and maxOccurs are explicitly prohibited \
for both the named group as well as any of the children of the named group. Here is \
the relevent part of schema for schema (http://www.w3.org/2001/XMLSchema.xsd) notice \
the minOccurs and maxOccurs prohibited below ...
------------
<xs:complexType name="namedGroup">
<xs:complexContent>
<xs:restriction base="xs:realGroup">
<xs:sequence>
<xs:element ref="xs:annotation" minOccurs="0"/>
<xs:choice>
<xs:element name="all">
<xs:complexType>
<xs:complexContent>
<xs:restriction base="xs:all">
<xs:group ref="xs:allModel"/>
<xs:attribute name="minOccurs" use="prohibited"/>
<xs:attribute name="maxOccurs" use="prohibited"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="choice" type="xs:simpleExplicitGroup"/>
<xs:element name="sequence" type="xs:simpleExplicitGroup"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:NCName" use="required"/>
<xs:attribute name="ref" use="prohibited"/>
<xs:attribute name="minOccurs" use="prohibited"/>
<xs:attribute name="maxOccurs" use="prohibited"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="simpleExplicitGroup">
<xs:complexContent>
<xs:restriction base="xs:explicitGroup">
<xs:sequence>
<xs:element ref="xs:annotation" minOccurs="0"/>
<xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="minOccurs" use="prohibited"/>
<xs:attribute name="maxOccurs" use="prohibited"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
------------------------------------
-----Original Message-----
From: Sycheu@aol.com [mailto:Sycheu@aol.com]
Sent: Thursday, February 12, 2004 8:25 PM
To: xmlbeans-dev@xml.apache.org
Subject: "minOccurs", "maxOccurs" attribute not allowed error
Hi,
I am trying to use xmlbeans to generate JavaClass.
I got this error:
[xmlbean] anguage.xsd:405: error: Attribute not allowed: minOccurs in element \
choice@http://www.w3.org/2001/XMLSchema [xmlbean] language.xsd:405: error: Attribute \
not allowed: maxOccurs in element choice@http://www.w3.org/2001/XMLSchema
Here is the part of the schema causing the problem:
<group name="contentControlGroup">
<choice minOccurs="0" maxOccurs="unbounded">
<group ref="smil20lang:switchGroup"/>
<group ref="smil20lang:prefetchGroup"/>
</choice>
</group>
There are other part in the same schema which uses "minOccurs", "maxOccurs" too, but \
it works, only the above case does not work. this case works!
<choice minOccurs="0" maxOccurs="unbounded">
<any namespace="##other" processContents="lax"/>
</choice>
Can someone please tell me how to resolve this?
The schema is part of a standard, so I think there should be no error in the schema \
itself.
I appreciate if anyone can help me with this issue.
Thanks.
- ---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic