W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

Namespace qualification

From: Gregory Khanlarov <kh_greg@hotmail.com>
Date: Tue, 22 Jan 2002 16:54:10 -0500 (EST)
To: <xmlschema-dev@w3.org>
Message-ID: <DAV40rYP0QzBxhJTANZ0001866b@hotmail.com>
Hi,

I have namespace qualification question.
Suppose, we have the following schema:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="aaa"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
>
<element name="a">
    <complexType>
        <simpleContent>
            <restriction base="string">
                <attribute name="q"/>    <!-- Attribute must be unqualified,
since attributeFormDefault equals to 'unqualified' -->
                <attribute name="w" form="qualified" />    <!-- Here we
state that the attribute must be qualified -->
            </restriction>
        </simpleContent>
    </complexType>
</element>
</schema>

Thus, we have string-content element "a" with two attributes. Attribute 'q'
must be unqualified and attribute 'w' must be qualified. Is the following
XML instance valid ?

<a xmlns="aaa" q="1" w="2"/>

I believe, this is ambiguos case. According to the spec
(http://www.w3.org/TR/REC-xml-names/#defaulting) default namespaces do not
apply directly to attributes. However, the attribute's namespace is
considered to be the same as element's namespace if no namespace prefix is
specified for the attribute. Am I right ? So, if there is an error than
where is it ? In namespace qualification of attribute 'q' or 'w' ?

Thank you,
Gregory
Received on Wednesday, 23 January 2002 13:41:36 GMT

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