W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2001

Global attributes

From: Ken Haiya <kenhaiya@trestla.com>
Date: Thu, 23 Aug 2001 13:53:52 -0400 (EDT)
To: <xmlschema-dev@w3.org>
Message-ID: <B7AA90F5.12449%kenhaiya@trestla.com>
I have an issue with attributes that are declared under the schema element.

Given the following global declarations (assuming default namespace is that
of XML Schema, targetNamespace = "myNamespace", elementFormDefault =
"qualified", attributeFormDefault = "unqualified":

    <attribute name = "foo" type = "string"/>

    <element name = "bar">
        <complexType>
            <attribute name = "baz" type = "integer"/>
        </complexType>
    </element>

Is the following markup valid in an instance (assuming default namespace =
"myNamespace" and xmlns:my = "myNamespace")?

    <bar baz="27" my:foo="boo"/>

Since foo was never explicitly declared as an attribute of <bar>, shouldn't
the validation fail? Or is it the case that a global attribute can be added
to *any* element whether declared by the element's type or not.

Ken
Received on Friday, 24 August 2001 04:56:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:23 GMT