A
Alex Rootham
Hi,
I'm quite new to schema design, and was wondering if someone might
point out what I'm doing wrong when designing my Schema's
I have a need to do the following:
Schema1.xsd -- defines generic types/elements
Schema2.xsd -- defines specific types/elements
file1.xml -- an example xml that needs to conform to both schemas.
So, for example, Schema1.xsd defines a complex-type "subsystem".
Shema2.xsd also defines complex-type "subsystem", and in fact,
Schema2's subsystem is a specialization of Schema1's subsystem.
Thus, I want file1.xml to conform to Schema2's subsystem -- however, I
need auto-generated code from Schema1.xsd to properly parse file1.xml
-- file1.xml needs to conform to both Schema1.xsd and Schema2.xsd.
Example:
Schema1.xsd --
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:complexType name="subsystemType" mixed="true">
... generic...
</xs:complexType>
</xs:schema>
Schema2.xsd --
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:complexType name="subsystemType" mixed="true">
... specific example of generic from Schema1.xsd ...
</xs:complexType>
</xs:schema>
file1.xml --
<subsystem type="subsystemType">specific example</subsystem>
My question is -- how should I elate Schema1.xsd, Schema2.xsd and
file1.xml? Since Schema2.xsd is a specialization of Schema1.xsd, my
gut reaction was to derive the underlying types -- however, I cannot
do this in the case of having multiple specializations of subsystems.
Thanks for any help!
Alex
I'm quite new to schema design, and was wondering if someone might
point out what I'm doing wrong when designing my Schema's
I have a need to do the following:
Schema1.xsd -- defines generic types/elements
Schema2.xsd -- defines specific types/elements
file1.xml -- an example xml that needs to conform to both schemas.
So, for example, Schema1.xsd defines a complex-type "subsystem".
Shema2.xsd also defines complex-type "subsystem", and in fact,
Schema2's subsystem is a specialization of Schema1's subsystem.
Thus, I want file1.xml to conform to Schema2's subsystem -- however, I
need auto-generated code from Schema1.xsd to properly parse file1.xml
-- file1.xml needs to conform to both Schema1.xsd and Schema2.xsd.
Example:
Schema1.xsd --
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:complexType name="subsystemType" mixed="true">
... generic...
</xs:complexType>
</xs:schema>
Schema2.xsd --
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:complexType name="subsystemType" mixed="true">
... specific example of generic from Schema1.xsd ...
</xs:complexType>
</xs:schema>
file1.xml --
<subsystem type="subsystemType">specific example</subsystem>
My question is -- how should I elate Schema1.xsd, Schema2.xsd and
file1.xml? Since Schema2.xsd is a specialization of Schema1.xsd, my
gut reaction was to derive the underlying types -- however, I cannot
do this in the case of having multiple specializations of subsystems.
Thanks for any help!
Alex