Re: Derivation problems

"Nick K. Aghazarian" <Ace@AceProgrammer.com> writes:


> The basic structure of the document is:
> <XMLData>
>    <Service xsi:type="ExtendedType1">
>        <InputData>
>            <FieldName>FieldValue</FieldName>
>            <Field2Name>Field2Value</Field2Name>
>        </InputData>
>    </Service>
> </XMLData>

Two problems right away, sorry:  there's no namespace declaration for
either your own namespace or the XMLSchema-instance namespace in
your instance, and there's no type called ExtendedType1 in your
schema.  I can't really help until you send the real files you're using.

> <schema xmlns="http://www.w3.org/1999/XMLSchema"
>    xmlns:XD="http://www.company.com/Schemas/XMLData"
>    targetNamespace="http://www.company.com/Schemas/XMLData">
> 
> <complexType name="Service" content="elementOnly" >
> </complexType>
> 
> <complexType name="T1">
>    <group ref="XD:T1Fields" />
> </complexType>
> 
> <group name="T1Fields">
>    <all>
>        <element name="User" type="string" minOccurs="0" />
>        <element name="TxnDate" type="timeInstant" minOccurs="0" />
>    </all>
> </group>
> 
> <complexType name="ExtendedServiceType1" base="XD:Service"
>        content="elementOnly" derivedBy="extension">
>    <all>
>        <element name="InputData" type="XD:ET1" minOccurs="0" />
>        <element name="OutputData" type="XD:ET1" minOccurs="0"
> maxOccurs="1" />
> 
>    </all>
>    <attribute name="ServiceType" type="string" use="default"
> value="ExtendedType1" />
> 
> </complexType>
> 
> <complexType name="ET1" base="XD:T1" derivedBy="extension">
>    <group ref="XD:ET1Fields" />
> </complexType>
> 
> <group name="ET1Fields">
>    <all>
>        <element name="Object" type="string" minOccurs="0" />
>        <element name="Action" type="string" minOccurs="0" />
>    </all>
> </group>
> 
> </schema>

> Detected during instance validation
> http://www.aceprogrammer.com/XMLData/XMLExtendedServiceType1.xsd:6:1:
>    Invalid: non-deterministic content model for type
>        ExtendedServiceType1: {Wildcard: ##any}/{None}:InputData

That means what it says:  your content model is invalid because it
derives from the urType by extension, which means first it accepts
any amount of anything, and then InputData or OutputData.  That's
unacceptable, because it doesn't know whether to accept InputData as
anything or as itself.  You probably meant the Service type to be
empty, in which case say so:

 <complexType name="Service" content="empty" />


>       Problems with the schema-validity of the target
> 
> 
> http://www.aceprogrammer.com/XMLData/XMLData.xml:5:2:
>    Warning: using xsi:type
> {http://www.company.com/Schemas/XMLData}:ExtendedServiceType1

That's not an error, just a notice that your xsi:type is working
(although this can't be the instance you show above)

> http://www.aceprogrammer.com/XMLData/XMLData.xml:6:3:
>    Warning: allowing
> {http://www.company.com/Schemas/XMLData}:InputData because
> 
>        it matched wildcard(##any)
>        ::: Warning: validating it laxly

This is probably a side-effect of the error in the Service type
mentioned above.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Tuesday, 12 September 2000 16:01:01 UTC