W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

Schema "can I" question...

From: <MarkH@i2.co.uk>
Date: Wed, 10 Jan 2001 12:50:56 -0000
Message-ID: <1E73B637CFC3D411A12F00B0D0795DDD091499@uknts40exh01.i2.co.uk>
To: xmlschema-dev@w3.org
As my customization of schemas posting has mustered no response, I'll focus
on the critical aspect and ask...

1) Can I allow arbitrary (i.e. unanticipated) elements in a <sequence>?
2) Alongside other specified elements?

For example (see below), can I write a schema that explicitly describes
<personItem> and <vehicleItem> (and would validate that instances of these
items complied with the schema's type definition for them), while also
allowing <witnessItem> which does not appear in the schema?

Note: <items> is a collection of zero or more items from a range of possible
types which represent entities (people, vehicles, buildings etc.) which have
different properties (firstName, lastName etc.).

I want to define a basic schema structure, but allow people to include their
own types without having to modify the schema. Validation would trap misuse
of the anticipated types but simple not check anything in an items section
that wasn't explicitly defined.

<myDocument>
 <items>
   <personItem id='e0001'>
    <comment>A software consultant</comment>
    <firstName>Mark</firstName>
    <lastName>Hughes</lastName>
   </item>

   <personItem id='e0002'>
    <comment>W3C Fellow</comment>
    <firstName>Henry</firstName>
    <lastName>Thompson</lastName>
   </item>
 
   <vehicleItem id='e0003'>
    <comment>Involved in accident</comment>
    <make>Ford</make>
    <color>Red</color>
   </vehicleItem>

   <witnessItem id='e0004'>
    <comment>Witnessed in accident</comment>
    <make>Ford</make>
    <color>Red</color>
   </vehicleItem>
 </items>
</myDocument> 

Thanks

Mark
--
Mark Hughes
  Agile HTML Editor
    http://www.agilic.com
Received on Wednesday, 10 January 2001 07:58:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT