[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Does DTD validation work with namespaces?

  • From: Wayne Steele <xmlmaster@h...>
  • To: xml-dev@l...
  • Date: Tue, 08 Aug 2000 13:36:30 -0700 (PDT)

svg namespace validation w3

Problem:

What we _REALLY_ want is for DTDs to "know about" namespaces; to treat 
"p:foo", "p1:foo", and "foo" differently or indentically depending on the 
namespace declarations in scope.

This is really hard, and probably impossible to do without reworking DTDs.

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.

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.

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.


What do you think?


-Wayne Steele










________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.