Re: Pointless <sequence>, <choice>, <all>

Hello,

I definitely need some help for understanding how these pointless
particles works.

For example, applying strictly the rules seems to forbid some
restriction that look quite reasonable, like the following:

<xs:element name="user-id" type="xs:string"/>
<xs:element name="email" type="xs:string" sustitutionGroup="user-id"/>

<xs:complexType name="user">
<xs:sequence>
<xs:element ref="user-id"/>
<xs:element name="nickname" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="user-simple">
<xs:complexContent>
<xs:restriction base="user">
<xs:sequence>
<xs:element ref="user-id"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

Am I right in saying that user-simple is not a valid restriction of user?

My rational is that in the restriction the sequence becomes pointless,
and the element which is the head of a substitution is to be considered
as a choice, and as a choice cannot restrict a sequence, the restriction
looks invalid...

Thanks,

Michael Marchegay


Michael Marchegay wrote:

>
> Hello,
>
> I find the text describing "pointless" particles (3.9.6 Constraints on
> Particle Schema Components - Schema Component Constraint: Particle Valid
> (Restriction)) a bit unclear.
>
> The first question I have is why does the text mixes XML Element
> Information Items and Schema Components?
>
> For example what is "The <sequence>'s {particles}"?
>
> Or what is a <all> whose {particles} is empty? If an <all> with no
> <element> child is used within a <complexType>, isn't it supposed to
> mean that the content type of the complex type is empty? If so is these
> a particle created for that <all> that could justify the reference to
> the {particles} property?
>
> Second question: is the sequence in the following complex type pointless?
>
> <complexType>
> <sequence>
> <element name="e"/>
> </sequence>
> </complexType>
>
> If yes, how could the following condition be verified?
>
> 2.2.2.1 The particle within which this <sequence> appears has {max
> occurs} and {min occurs} of 1.
>
> If no, does the following <complexType> express a valid complex type
> definition?
>
> <complexType>
> <complexContent>
> <restriction base="anyType">
> <all>
> <element name="e"/>
> </all>
> </restriction>
> </complexContent>
> </complexType>
>
> Thanks,
>
> Michael Marchegay
>
>
>
>

Received on Friday, 24 October 2003 17:41:24 UTC