Namespaces: silly question

Lars Marius Garshol larsga at ifi.uio.no
Fri Aug 7 10:54:53 BST 1998


Here's a really stupid question that I haven't been able to figure out
the answer to:

Sral, the naive XML developer, is developing an XML application. He
writes a DTD that embeds John Cowans IBTWSH DTD in a certain place to
provide for documentation. The IBTWSH DTD at some point contains this
declaration:

  <!ELEMENT P (%some-pe;)>

and Srals DTD contains:

  %insert-IBTWSH-here;


So far, all is well. These documents are supposed to be processed in
part by software written for IBTWSH documents, so Sral adds to his DTD
the following declaration:

  <!ATTLIST IBTWSH-root-element 
            xmlns:IBTWSH "http://www.purl.org/foo" #FIXED>

so that all IBTWSH elements will use the IBTWSH namespace by default.

Then, somewhere in one of his documents, Sral writes:

  <IBTWSH:P>Huba!</IBTWSH:P>


This is where the problems begin. (Well, they really started above,
but it's easier to see here.) Srals validating parser can now do one
of three things if it supports namespaces:

  a) complain that the IBTWSH:P element has not been declared. (Which
     is literally true: it was declared as P.)
  b) complain that the http://www.purl.org/foo:P element has not been
     declared.
  c) strip out the namespace prefix and have IBTWSH:P blithely collide
     with the Sral:P defined in Srals DTD.
   

In other words: as far as I can understand either DTDs must use the
full namespace names in all declarations, as in

  <!ELEMENT http://www.purl.org/foo:P ...>  

(which is truly unreadable, and also not well-formed) or there must be
some means by which a DTD can declare its namespace, which will of
course be difficult since one may want to mix namespaces.

I can't imagine that the XML WG has failed to think of this, so if
some kind soul could point out what I have failed to think of here I
would be most grateful. Thanks.

-- 
"These are, as I began, cumbersome ways / to kill a man. Simpler, direct, 
and much more neat / is to see that he is living somewhere in the middle /
of the twentieth century, and leave him there."     -- Edwin Brock

 http://www.stud.ifi.uio.no/~larsga/      http://birk105.studby.uio.no/



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