Namespaces/XSchema Spec - XSchema Element (Sections 2.0 and 2.1), Draft 6

Simon St.Laurent SimonStL at classic.msn.com
Wed Aug 5 01:44:01 BST 1998


Two ideas I _really_ like, though I'm not 100% sure of their acceptability.

First, from John Cowan:
> <!ATTLIST XSchema
>	xmlns:XSC CDATA #FIXED "(XSchema URI)"
>	xmlns CDATA #FIXED "(XSchema URI)">
>
>thus making either XSC or null a valid prefix for XSchema.  Then
>all XSchema elements are declared in the DTD with no colons except
>XSC:Doc and XSC:More, which have ATTLIST declarations thus:
> 
> <!ATTLIST XSC:Doc
>	xmlns CDATA #FIXED "">
> <!ATTLIST XSC:More
>	xmlns CDATA "">
>
>and likewise for XSC:More.  Then within the XSC:Doc and XSC:More
>elements there is no default prefix, which is what IBTWSH wants.
>XSC:More users can override this with an explicit xmlns attribute.

Basically, the point of this is to allow XSchema declarations to use the 
default namespace, while still allowing the components under Doc and More to 
have 'freedom of namespace' or somesuch.  (I'll probably make XSC:Doc implied, 
not fixed.)

Is this practice acceptable?  The XSC prefix will have to be used on both 
XSC:Doc and XSC:More because they assign the default namespace to something 
other than the XSchema identifier.  I don't see any reason the same URN can't 
be used twice, and end up equivalent.  If it's kosher, it's going in.

----------------------------

The second provides for more flexible prefix handling within XSchemas, and 
will have a direct impact on Section 3.0 more than 2.0.

The second idea, for avoiding namespace collisions within XSchema, comes from 
Peter Murray-Rust:
> <!DOCTYPE XSC SYSTEM "XSchema.dtd" [
> <!-- help - a collision - let's override FOO -->
> <!ENTITY foo "newFOO">
> <!ENTITY foo "FOO">
> ]>
>
>...
> <ElementDecl Name="&foo;:bar">
>   <Empty/>
> </ElementDecl>
> <AttDef Element="&foo;:bar" Name="xmlns:&foo;" Type="CData" Required="Yes" 
> AttValue="&foo; URI"/>
>
>
>That allows a single change in the XSchema definition file to percolate
>through the whole file. I actually think this is cleaner and more powerful
>than PEs for maintenance.

This works to some extent, allowing the XSchema designer to change the prefix, 
but it still requires changes in the XSchema and not just in the document 
instance.  There are other fun things we could do, like adding an attribute to 
XSC:XSchema elements that identifies the namespace in which they live via the 
URN (forget the prefix), but I'm really not sure what's best here.

All suggestions, public or private, are welcome.

Simon St.Laurent
Dynamic HTML: A Primer / XML: A Primer / Cookies


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list