RE: Alternative versions of an element within one schema

The xsi:type attribute allows you to use an attribute to constrain a content
model.  

xsi:type is special in this way - it is pretty much the only "co-occurrence
constraint" of this nature involving element and attributes that is
supported by XML Schema.  

_____
Simon.Cox@csiro.au  CSIRO Exploration & Mining
26 Dick Perry Avenue, Kensington WA 6151
PO Box 1130, Bentley WA 6102  AUSTRALIA
T: +61 (8) 6436 8639  F: +61 (8) 6436 8555  C: +61 (4) 0330 2672
http://www.csiro.au/page.asp?type=resume&id=CoxSimon

> -----Original Message-----
> From: Paul B. Anderson [mailto:paul@pnlassociates.com]
> Sent: Thursday, 7 March 2002 7:08 AM
> To: xmlschema-dev@w3.org
> Subject: Alternative versions of an element within one schema
> 
> 
> Hi:
> 
> I'm trying to find a way to handle multiple versions of an element
> definition within a single schema.  I keep running into UPA problems
> (among others) so I was wondering if anyone has solved this problem.
> 
> I want to allow a single schema to validate instance documents like
> 
> <root>
>   <a version="1.0">
>     ... some complex content
>   </a>
> </root>
> 
> or
> 
> <root>
>   <a version="2.0">
>     ... complex content but different from version 1.0 in some way
>   </a>
> </root>
> 
> I have tried defining two groups, a10 and a20, that each have a fixed
> value of attribute version.  These are then listed in the schema under
> <root> within a choice element.
> 
> How can I make this work?  It seems as if it is an important 
> situation.
> 
> Thanks,
> 
> Paul
> 
> 

Received on Thursday, 7 March 2002 04:23:49 UTC