W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2000

Derivation problems

From: Nick K. Aghazarian <Ace@AceProgrammer.com>
Date: Tue, 12 Sep 2000 11:41:43 -0700
Message-ID: <39BE78E7.10309@AceProgrammer.com>
To: www-xml-schema-comments@w3.org

I've been trying to define my XML data stream with Schema for some time 
now, and I
keep running into roadblocks.  I thought I'd worked around most of them, 
and started
putting my schemas and instance docs through the validator to see how I 
did (I probably
should have started there to begin with, but oh well...).  Since I'm 
using the W3
Validator and it's still alpha, what I'm encountering may just be bugs 
in the validator,
but I'm not sure.

Thanks for any guidance,


Here's my situation:  I have a document that I can process, although I 
have some default
values that will have to be coded for if I don't get them from the 
parser via the Schema.

The basic structure of the document is:
   <Service xsi:type="ExtendedType1">

<schema xmlns="http://www.w3.org/1999/XMLSchema"

<complexType name="Service" content="elementOnly" >

<complexType name="T1">
   <group ref="XD:T1Fields" />

<group name="T1Fields">
       <element name="User" type="string" minOccurs="0" />
       <element name="TxnDate" type="timeInstant" minOccurs="0" />

<complexType name="ExtendedServiceType1" base="XD:Service"
       content="elementOnly" derivedBy="extension">
       <element name="InputData" type="XD:ET1" minOccurs="0" />
       <element name="OutputData" type="XD:ET1" minOccurs="0" 
maxOccurs="1" />
   <attribute name="ServiceType" type="string" use="default" 
value="ExtendedType1" />

<complexType name="ET1" base="XD:T1" derivedBy="extension">
   <group ref="XD:ET1Fields" />

<group name="ET1Fields">
       <element name="Object" type="string" minOccurs="0" />
       <element name="Action" type="string" minOccurs="0" />


I need to override the Service type with one derived from it.  The 
resulting type will have
an attribute (ServiceType) that has a default value.  If I specify the 
attribute on the
Service type, I can't seem to set or override its default value in the 
derived type.
The result type will have derived types for each element.  I can't seem 
to get this to work
either.  If I leave the elements out of the Service type declaration (as 
I have above), I get
the following errors when trying to validate (if this is a bug in the 
validator, that's OK, I
just need to know).  I don't understand what the errors are telling me, 
so I'm having a bit of
trouble adjusting the schema to be valid.

Schema representation errors

Detected during instance validation
   Invalid: non-deterministic content model for type
       ExtendedServiceType1: {Wildcard: ##any}/{None}:InputData

Problems with the schema-validity of the target

   Warning: using xsi:type 

   Warning: allowing {http://www.company.com/Schemas/XMLData}:InputData 
       it matched wildcard(##any)
       ::: Warning: validating it laxly
Received on Tuesday, 12 September 2000 14:40:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:53 UTC