Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[XML Schema 1.1] defaultAttributes only apply within the schema

From: "Costello, Roger L." <costello@-----.--->
To: "xmlschema-dev@--.---" <-------------@--.--->
Date: 7/14/2009 12:51:00 PM
Hi Folks,

Below I show BookStore.xsd. It specifies defaultAttributes. It imports Book.xsd, which also has a defaultAttributes. 

The defaultAttributes specified in BookStore.xsd only applies to the complexTypes within that file, and the defaultAttributes specifies in Book.xsd only applies to the complexTypes within that file, correct?

/Roger


-------------------------------
    BookStore.xsd
-------------------------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.bookstore.org"
           xmlns="http://www.bookstore.org"
           xmlns:bk="http://www.book.org"
           defaultAttributes="bookstoreDefaultAttributes"
           elementFormDefault="qualified">

    <xs:import namespace="http://www.book.org"
               schemaLocation="Book.xsd" />

    <xs:element name="BookStore">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="bk:Book" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:attributeGroup name="bookstoreDefaultAttributes">
        <xs:attribute name="id" type="xs:ID" use="required" />
    </xs:attributeGroup>

</xs:schema>

-------------------------------
    Book.xsd
-------------------------------
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.book.org"
           xmlns="http://www.book.org"
           defaultAttributes="bookDefaultAttributes"
           elementFormDefault="qualified">

    <xs:element name="Book">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Title" type="xs:string"/>
                <xs:element name="Author" type="xs:string"/>
                <xs:element name="Date" type="xs:string"/>
                <xs:element name="ISBN" type="xs:string"/>
                <xs:element name="Publisher" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:attributeGroup name="bookDefaultAttributes">
        <xs:attribute name="class" type="xs:NMTOKENS" use="optional" />
    </xs:attributeGroup>

</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