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

fixing (just) namespaces and validation

  • From: "Simon St.Laurent" <simonstl@s...>
  • To: XML-Dev Mailing list <xml-dev@i...>
  • Date: Tue, 07 Sep 1999 18:27:14 -0400

xpdl namespace prefix
I brought this up earlier on a list of things that could be done to improve
XML, and it keeps ringing in my ears.

Namespaces and validation are incompatible in cases where the namespace
prefix changes for whatever reason, because XML 1.0 will validate based
only on the prefix. The Namespaces in XML Recommendation doesn't even
provide a mechanism for telling DTDs what URI might be associated with a
given prefix.

James Clark provides an explanation of this at
http://www.jclark.com/xml/xmlns.htm:
>It would of course be very useful to have namespace-aware validation: 
>to be able to associate each URI used in a universal name with some 
>sort of schema (similar to a DTD) and be able to validate a document 
>using multiple such URIs with respect to the schemas for all of the URIs. 
>The XML Namespaces Recommendation does not provide this. The reason is 
>is that DTDs have many other problems and missing features in addition 
>to lack of namespace-awareness. So the plan is to come up with a new 
>schema mechanism that fixes the problems with DTDs and, as part of this, 
>provides namespace-awareness. This work is being done by the XML Schema WG.

At the same time, Namespaces REC says: (end of Section 6, conformance)
>Thus, unless the use of a validating processor has been specified, 
>there can be no assurance that the contents of attribute values 
>have been checked for conformance to this specification.

Most people seem to have disregarded this notice, and use non-validating
processors when they use namespaces, if indeed they do use namespaces.
Those who validate simply pray that in these early days of XML processing
no one will have gotten around to changing a prefix for whatever reason.

It seems like DTDs will be here for a while, and it doesn't seem like
fixing this problem is difficult.  The PI from the 5/18 draft, which was
meant for documents, would serve just as well in DTDs.  It could provide a
simple mapping for prefixes as used in the DTD to the namespace URI,
allowing processors to validate against both the namespace URI and the
local part, rather than simply the element or attribute name.

For example: (Yes, I changed the colon to a dash.)
<?xml-namespace ns="http://www.simonstl.com/ns/1999/xpdl" prefix="xpdl"?>

When it appeared in the DTD, this would tell a validating processor that
the prefix xpdl maps to http://www.simonstl.com/ns/1999/xpdl.  If the
processor then encountered elements with a namespace URI of
http://www.simonstl.com/ns/1999/xpdl, it could validate them on the basis
of that URI and the local part even if the xpdl prefix had disappeared.

It seems very simple, even potentially worthwhile.  I don't think that it
would give parser builders enormous headaches, and it would take away a lot
of the technical ammunition of the anti-namespaces crowd.  Then we could
discuss the more painful issues of 'what does it mean?' without extra noise
about how weakly it's been implemented, and we wouldn't have to wait as
impatiently for the Schema WG to finish their labors.

Simon St.Laurent
XML: A Primer (2nd Ed - September)
Building XML Applications
Inside XML DTDs: Scientific and Technical
Sharing Bandwidth / Cookies
http://www.simonstl.com

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



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.