OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Does DTD validation work with namespaces?

[ Lists Home | Date Index | Thread Index ]
  • From: "Simon St.Laurent" <simonstl@simonstl.com>
  • To: Wayne Steele <xmlmaster@hotmail.com>, xml-dev@lists.xml.org
  • Date: Tue, 08 Aug 2000 17:32:10 -0400

At 01:36 PM 8/8/00 -0700, Wayne Steele wrote:
>This is really hard, and probably impossible to do without reworking DTDs.

For the most part, I don't think it's that difficult.  Identifying a
prefix->URI mapping within the DTD would give a parser an opportunity to
use that information against whatever namespaces it encounters in the
document.  Assembling multipart DTDs will still be somewhat tricky, but
this seems much simpler to me than stacking parameter entities on each
other's head.

>I think most people would accept, as a compromise, restricting
>themselves to a one-to-one mapping of prefix to namespace, if they could
>somehow inform the DTD of the proper prefix for each namespace (each
>document gets to make its own mapping). It would be nice to allow a
>many-to-one mapping.

I'm not sure we'll be able to get to many-to-one in a single step, but maybe.

>The question then becomes: How do you "inform" the DTD of the proper
>prefix for this instance document?
>
>Solution:
>One solution that's been discussed here is using the internal
>subset of the instance document, to "inform" the DTD through
>redeclaration of certain Entities.
>Careful use of Entity Refs in the DTD just barely allow you to get by with 
>this.

I'd rather just have a PI in the DTD or even a NOTATION that does the
mapping on the DTD side.  It'd require a new generation of processors, but
that might be acceptable for the use cases where this is necessary...

>Solution #2:
>This Just occured to me: The System Identifier! Since it's a
>URI, it has lots of room for sneaking stuff into it.
>Instead of having a URI like
>   "http://example.org/DTDs/MyDTD"
>you could use
>   
>"http://example.org/ProtoDTDs/MyProtoDTD?svg=http%3A%2F%2fwww.w3.org%2F2000
%2Fsvg"
>
>The web server would have to:
>   a. get the ProtoDTD
>   b. send it through a ProtoDTD-to-DTD processor, with this param:
>      svg=http://www.w3.org/2000/svg
>   c. return the new DTD to the requestor.
>
>For offline work, or without a whole web server:
>Instead of using the System Identifier
>   "file:c:/DTDs/MyDTD"
>I could set up a different URL handler, and use:
>   "ProtoDTD:svg=http%3A%2F%2fwww.w3.org%2F2000%2Fsvg@file:c:/DTDs/MyDTD"
>to do the same thing.
>
>The only downsides I can think of are:
>   Someone has to actually write the code to do this (shouldn't be too hard)
>   Comparing the System Identifiers of XML documents becomes much more 
>complicated
>   It makes the System Identifier really verbose and ugly.

Verbose and ugly is an understatement - I can't see this as workable.

Simon St.Laurent
XML Elements of Style / XML: A Primer, 2nd Ed.
http://www.simonstl.com - XML essays and books




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS