W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2003

RE: allowing zero to unbounded elements in any order?

From: Michael Case <mecase@ucdavis.edu>
Date: 16 Sep 2003 17:42:36 -0700
To: XSD <xmlschema-dev@w3.org>
Message-Id: <1063759356.2608.185.camel@hepse.ucdavis.edu>

Sorry to beat a dead horse...

XML Schema, therefore, can only be used to define a SUBSET of legal XML
documents, right?

In other words, a file can be a legal XML file and not be validatable
(if thats a word) by XML Schema.

The reason I ask is that like many people developing code using XML I
initially assumed that XML Schema could be used to validate any XML
file.  When I discovered one was stuck with the ordering difficulty I
looked at some other processors mentioned on this list.  However, I was
convinced by some on this list who use the "if order doesn't matter then
do it in the order the Schema enforces".

Then we started letting other developers use our API and they are saying
"why are you not able to allow the inside elements in any order?" 
grrrrr.  Well, maybe not that bad, but I'm just making sure I understand
things correctly.  I've told them that if they use a schema aware editor
it will make sure they put things in correctly and then they shouldn't
care about the order!  Oh well...

Just making sure I understand :-).



On Tue, 2003-03-18 at 10:11, Scott, Michael Gordon wrote:
> Jeni,
> I was afraid of that.  Thanks for all your insight.  It's been extremely
> helpful, and very educational.  I'll start using <xs:*> instead of <xsd:*>.
> I've seen both used in the MSMXL Parser SDK (which I only use for syntax
> help).
> Michael
>  -----Original Message-----
> From: 	Jeni Tennison [mailto:jeni@jenitennison.com] 
> Sent:	Tuesday, March 18, 2003 9:59 AM
> To:	Scott, Michael Gordon
> Cc:	Sam Carleton; xmlschema-dev
> Subject:	Re: allowing zero to unbounded elements in any order?
> Hi Michael,
> > Actually, NumWafers and Wafers are mandatory, they just want them in
> > any order. It's everything in :
> >
> >         <xsd:extension base="Type_ToolLotSummary">
> >
> > The Type_ToolLotSummary, which is above <xs:all> that is optional
> > (everyting), and also needed to be in any order.
> I'm sorry, I overlooked the fact that you were extending the type.
> <xs:all> can't be used in that context because when you extend a type
> you effectively create a sequence of the content from the base type
> followed by the content from the extension, and <xs:all> isn't allowed
> within a sequence. There's no way to build a type by extension and
> allow all the elements (from both the base type and the extension) to
> be present in any order. Sorry that I didn't spot that sooner.
> > Dumb question : Is <xs:???> and <xsd:???> the same thing?  
> Yes; I tend to use <xs:*> because that's what's used in the XML Schema
> Rec, and because it's shorter.
> Cheers,
> Jeni
> ---
> Jeni Tennison
> http://www.jenitennison.com/
Michael Case
Department of Physics
University of California, Davis
One Shields Avenue
Davis, California 95616
Received on Tuesday, 16 September 2003 20:44:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:13 UTC