W3C home > Mailing lists > Public > w3c-sgml-wg@w3.org > May 1997

Re: SD5 - Namespaces - New Version 2

From: Bert Bos <bert@w3.org>
Date: Sat, 24 May 1997 01:49:08 +0200
To: w3c-sgml-wg@w3.org
Message-ID: <33862CF4.313E@w3.org>
Andrew Layman wrote:
> <xml-namespace><ref>http://www.bigbookstore.com/schema</ref><as>bk</as></xml-namespace>
> 
> <xml-namespace><ref>http://www.w3.org</ref><as>w3</as></xml-namespace>
>          <bk:ORDERS>
> 
> <xml-namespace><ref>http://purl.org/dublincore</ref><as>dc</as></xml-nam
> espace>
> 
> <xml-namespace><ref>http://www.shipping.com</ref><as>sh</as></xml-namesp
> ace>
>                  <LINEITEM>
>                          <dc:NAME>Number, the Language of
> Science</dc:NAME>
>                          <dc:AUTHOR>Dantzig</dc:AUTHOR>
>                          <PRICE>5.95</PRICE>
>                          <sh:ZONE>9</sh:ZONE>
>                          <w3:DSIG> <DIGEST>1234567890</DIGEST>
> 
> <SIGNER>AndrewL@microsoft.com</SIGNER>
>                         </w3:DSIG>
>                 </LINEITEM >
>         </bk:ORDERS>
> </XML>

Why must the schema be part of the GI? Why not write

(1)    ...
       <author xml-schema="http://purl.org/dublincore">Dantzig<>
       ...

instead? Another way would be to write

(2)    ...
       <!doctype author "http://purl.org/dublincore">
       <author>Dantzig<>
       ...

but solution (1) has the advantage that it can be defaulted:

       <?xml-defaults author
           xml-schema = "http://purl.org/dublincore">
       ...
       <author>Dantzig<>
       ...
       <author>Layman<>

Note 1. Although many schemas may be used in a single document, each
element only conforms to one of them at a time. This is important,
because multiple inheritance would be a real can of worms.

Note 2. There is a difference between "schema" and "scheme". In the
example above, the AUTHOR element would be taken to contain the name of
an author, because of the Dublin Core schema, but DC doesn't prescribe
any scheme, so we still don't know how to decode the content of the
element. I suggest that Dublin Core is not a real, concrete schema, but
a "meta-schema". A real schema would include a way to find out what the
scheme for the content was.

Note 3. All the examples assume that the name of the element (AUTHOR)
is fixed. You cannot have an element named, e.g., AUTEUR and have it
function like the thing called "author" in the schema. This may be a
problem, see also note 6. A solution could be to use a fragment-id to
explicitly indicate the name in the schema:
xml-schema="http://purl.org/dublincore#author"

Note 4. Like all solutions that involve attributes with
"xml-" in their name, this is an architectural form.

Note 5. Keeping the URL as an attribute of the element avoids an extra
indirection, but more importantly also avoids long-distance
dependencies.
It is hard to be certain that the XML-NAMESPACE element in Andrew's
example is still in scope when the AUTHOR element is reached.

Note 6. Schemas can be nested, but there is a clear boundary where the
authority of one schema ends and the next one begins. In the example,
AUTHOR is a valid element inside a LINEITEM, but the schema (or DTD) for
LINEITEM does not regulate what can be inside the AUTHOR element,
because
AUTHOR has its own schema. This may be a problem, since, as note 3
mentioned, the schema for LINEITEM may require an AUTEUR element, but
the
Dublin Core calls it an "author" instead.



Bert

PS. "<>"
is my candicate for the short end-tag.
Received on Friday, 23 May 1997 19:49:11 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:26 UTC