Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


redefine type in case of multiple indirect sibling includes

From: "James Taylor" <JTaylor@--------.--->
To: <xmlschema-dev@--.--->
Date: 1/28/2005 9:13:00 AM
Hi All,

 

I'm getting conflicting results from different tools regarding the
validity of a redefine scenario and was hoping you could clear things
up.  Can a type be redefined within the scope of a schema if the schema
defining the type also indirectly includes the type through a sibling
include statement?

 

Here's an example:

    Company.xsd redefines the Address type from Location.xsd which
includes Address.xsd

    Company.xsd includes Employee.xsd which also includes Address.xsd

 

Should I receive errors about duplicate definitions for the Address
type?  If this is not valid, how do I properly redefine the Address type
within the Company.xsd schema?  Thanks,

 

    James

 

Company.xsd

<xs:schema elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:redefine schemaLocation="Location.xsd">

        <xs:complexType name="Address">

            <xs:complexContent>

                <xs:extension base="Address">

                    <xs:sequence>

                        <xs:element name="country" =
type="xs:string"/>

                    </xs:sequence>

                </xs:extension>

            </xs:complexContent>

        </xs:complexType>

    </xs:redefine>

    <xs:include schemaLocation="Employee.xsd"/>

        <xs:element name="company" type="Company"/>

            <xs:complexType name="Company">

                <xs:sequence>

                    <xs:element name="location" type="Location"/>

                    <xs:element name="employee" type="Employee"
maxOccurs="unbounded"/>

        </xs:sequence>

    </xs:complexType>

</xs:schema>

 

Location.xsd

<xs:schema elementFormDefault="unqualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:include schemaLocation="Address.xsd"/>

    <xs:complexType name="Location">

        <xs:sequence>

            <xs:element name="address" type="Address"/>

        </xs:sequence>

    </xs:complexType>

</xs:schema>

 

Employee.xsd

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema elementFormDefault="qualified"
attributeFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:include schemaLocation="Address.xsd"/>

    <xs:complexType name="Employee">

        <xs:sequence>

            <xs:element name="name" type="xs:string"/>

            <xs:element name="address" type="Address"/>

        </xs:sequence>

    </xs:complexType>

</xs:schema>

 

Address.xsd

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema elementFormDefault="unqualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:complexType name="Address">

        <xs:sequence>

            <xs:element name="street" type="xs:string"/>

            <xs:element name="city" type="xs:string"/>

            <xs:element name="zipCode" type="xs:string"/>

        </xs:sequence>

    </xs:complexType>

</xs:schema>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent