RE: SD5 - Namespaces - New Version 2

There are lot of good questions in the mail below.  I answer them
inline, preceded by [Andrew Layman].

--Andrew Layman
   AndrewL@microsoft.com

> -----Original Message-----
> From:	Bert Bos [SMTP:bert@w3.org]
> Sent:	Friday, May 23, 1997 4:49 PM
> To:	w3c-sgml-wg@w3.org
> Subject:	Re: SD5 - Namespaces - New Version 2
> 
> 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-n
> am
> > espace>
> > 
> >
> <xml-namespace><ref>http://www.shipping.com</ref><as>sh</as></xml-name
> sp
> > 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? 
> 
	[Andrew Layman] How would I write a restricted content model?
To really validate, the content model would need to specify, in effect,
"author from the Dublin Core".  If I understand your suggestion, the
content model could say "author" but could not say "from the Dublin
Core."

> 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.
> 
	[Andrew Layman]  
	Multiple Inheritance is much more complicated than what I want.
I propose simply that an entity be allowed to have names from multiple
namespaces, and that we have a simple mechanism to put the namespace as
part of the name.

> 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.
> 
	[Andrew Layman]  
	Dublin Core is a namespace and a very abstract schema.  Someday,
when we have element subclassing, we will be able to use it in
machine-readable schemes.

> 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"
> 
	[Andrew Layman]  
	All solutions that I've ever seen for this (including
Architectural Forms, to the extent I understand them) involve some sort
of subclassing.  Regarding fragment ids, I've been told by many people
that their processing is unreliable. In addition, I want the schema, not
just one term from it.

> 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.
> 
	[Andrew Layman]  
	Long-distance dependencies have not been a problem with DOCTYPE.
Regarding "hard to be certain" do you mean that my intention is unclear,
or that writing a program to keep track would be difficult?  Actually,
keeping track is very easy: search the sub-elements of your ancestral
nodes for XML-SCHEMA elements. A more efficient and only slightly harder
to program solution would be to keep a stack.  

> 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.
> 
	[Andrew Layman]  That won't be solved until we have subclassing,
at which point it will cease to be a problem.


> Bert
> 
> PS. "<>"
> is my candicate for the short end-tag.
> 
	[Andrew Layman]  What can I say?

Received on Friday, 23 May 1997 21:32:45 UTC