W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2001

Target Namespaces & Unqualified Locals (Section 3.1 of the primer)

From: Stefan Wachter <stefan.wachter@db.com>
Date: Wed, 4 Apr 2001 16:50:01 +0100
To: www-xml-schema-comments@w3.org
Message-ID: <OFCF73E75F.59F45E02-ON41256A24.00550100@db.com>

Hey everbody.

I am designing a multi-schema application in which each schema must have its own target namespace. The attributes "attributeFormDefault" and "elementFormDefault" are left to their default, i.e. "unqualified" which means that only global elements have to be prefixed. The corresponding example in the primer is:

<?xml version="1.0"?>
<apo:purchaseOrder xmlns:apo="http://www.example.com/PO1"
                   orderDate="1999-10-20">
    <shipTo country="US">
        <name>Alice Smith</name>
        <street>123 Maple Street</street>
        <!-- etc. -->
    </shipTo>
    <billTo country="US">
        <name>Robert Smith</name>
        <street>8 Oak Avenue</street>
        <!-- etc. -->
    </billTo>

    <apo:comment>Hurry, my lawn is going wild!</apo:comment>    <=== unnecessary prefix

    <!-- etc. -->
</apo:purchaseOrder>

In this example the root element <apo:purchaseOrder> and the nested element <apo:comment> are prefixed, because they both correspond to globally defined elements.
However the <apo:comment> element also corresponds to a locally declared element declaration (that in turn refers to a global declaration).

Therefore the prefix in the comment element can (and should) be dropped without loosing any information. This would allow instance document writers to be sure that they
must NEVER use prefixes except for the root element! This would make life much easier!

Thanks for your attention,

Stefan Wachter





--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Received on Wednesday, 4 April 2001 10:50:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT