W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2002

RE: Restricting substitution groups?

From: Mark Feblowitz <mfeblowitz@frictionless.com>
Date: Thu, 7 Feb 2002 13:15:27 -0500
Message-ID: <4DBDB4044ABED31183C000508BA0E97F040AB85E@fcpostal.frictionless.com>
To: "'Martin Gudgin'" <marting@develop.com>
Cc: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
What do you use to validate with MSXML 4? Is there particular VB or
javascript that you use? 

I know it sounds old-fashioned, but I sure wish there was a command line
executable for me to run. 

Of course, better yet would be a full interactive development environment.
XML Spy uses its own validating parser (even though it uses MSXML for its
XSL processing).

Any pointers would be appreciated.


Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
400 Technology Square, 9th Floor 
Cambridge, MA 02139 

-----Original Message-----
From: Martin Gudgin [mailto:marting@develop.com]
Sent: Thursday, February 07, 2002 5:47 AM
To: Eric van der Vlist; xmlschema-dev@w3.org
Subject: Re: Restricting substitution groups?


My take on this is that it is OK.

The table shown under Particle Valid: Restriction could be said to be
misleading as it forbids base of element and derived of choice. Perhaps one
way of thinking about it is that the element ref is in fact a ref to a
choice group rather than an element decl and hence corresponds to a choice
particle. However, I agree that Clause 2 of RecurseLax[1] is problematic in
this case.

Sounds to me like the easiest fix is to say, when the choice your
restricting is in fact a synthetic choice due to a substitution group then
the order rule does not apply.

I note that Xerces 1.4.4 and MSXML 4.0 both deal with your schema ( and
instance crufted up by me ) perfectly well.


[1] http://www.w3.org/TR/xmlschema-1/#rcase-RecurseLax

----- Original Message -----
From: "Eric van der Vlist" <vdv@dyomedea.com>
To: <xmlschema-dev@w3.org>
Sent: Thursday, December 06, 2001 4:38 PM
Subject: Restricting substitution groups?

> Given that a substitution group is kind of equivalent to xs:choice:
> http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict
> 2.1 Any top-level element declaration particle (in R or B) which is the
> {substitution group affiliation} of one or more other element
> declarations is treated as if it were a choice group whose {min occurs}
> and {max occurs} are those of the particle, and whose {particles}
> consists of one particle with {min occurs} and {max occurs} of 1 for the
> top-level element declaration and for each of the declarations in its
> ·substitution group·.
> Does that mean that we can restrict substitution groups?
> If for instance I have:
> <xs:element name="head"/>
> <xs:element name="a" substitutionGroup="head"/>
> <xs:element name="b" substitutionGroup="head"/>
> <xs:element name="c" substitutionGroup="head"/>
> and:
> <xs:complexType name="base">
>   <xs:sequence>
>     <xs:element ref="head"/>
>   </xs:sequence>
> </xs:complexType>
> is
> <xs:complexType name="derived">
>   <xs:complexContent>
>    <xs:restriction base="base">
>     <xs:sequence>
>       <xs:choice>
>         <xs:element ref="a"/>
>         <xs:element ref="b"/>
>       </xs:choice>
>     </xs:sequence>
>    </xs:restriction>
>   </xs:complexContent>
> </xs:complexType>
> a valid restriction?
> I guess not since it doesn't seem to match the condition for restricting
> choices:
> Schema Component Constraint: Particle Derivation OK (Choice:Choice --
> RecurseLax)
> For a choice group particle to be a ·valid restriction· of another
> choice group particle all of the following must be true:
> 1 R's occurrence range is a valid restriction of B's occurrence range as
> defined by Occurrence Range OK (§3.9.6);
> 2 There is a complete ·order-preserving· functional mapping from the
> particles in the {particles} of R to the particles in the {particles} of
> B such that each particle in the {particles} of R is a ·valid
> restriction· of the particle in the {particles} of B it maps to as
> defined by Particle Valid (Restriction) (§3.9.6).
> NOTE: Although the ·validation· semantics of a choice group does not
> depend on the order of its particles, derived choice groups are required
> to match the order of their base in order to simplify checking that the
> derivation is OK.
> The question should then probably be which is the order of the elements
> of a substitution group when they are mapped to a xs:choice during
> validation (and how can this be used to restrict a substitution group) ?
> Thanks
> Eric
> --
> See you in Orlando for XML 2001.
>                                      http://www.xmlconference.net/xmlusa/
> ------------------------------------------------------------------------
> Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
> http://xsltunit.org      http://4xt.org           http://examplotron.org
> ------------------------------------------------------------------------
Received on Thursday, 7 February 2002 13:16:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:58 UTC