Sign In/My Account | View Cart  
advertisement

Article:
 XML Namespaces Don't Need URIs
Subject: That won't work
Date: 2005-04-19 02:44:13
From: olegtkachenko

That won't work. People are using both xs and xsd prefixes for XML Schema for years now.
And removing namespace URIs would just just shift the uniqness requirement to prefixes, which would lead to ugly lengthy ones.

Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • That won't work
    2005-04-19 03:01:51 mikeday

    I think it is worth considering alternative methods for disambiguation that do not require giving every element a globally unique name, which in most cases is overkill.


    For example, why not use a regular attribute on the root element to identify the "type" of the document, but without needing to propagate that attribute down to the child elements like a namespace. That would allow disambiguation while eliminating the scoping issues.


    The different approaches taken to versioning by XSLT 2.0 and XHTML 2.0 are an interesting example. XSLT has a version attribute and keeps the same namespace, while XHTML 2.0 is in an entirely different namespace, even though most of the elements are identical to those in XHTML 1.0.


    I think that the approach taken by XSLT is more practical, but as I show in the article XSLT can get by quite happily without any namespace at all. The namespace is only necessary for a process which accepts many different kinds of XML documents whose root element is <xsl:stylesheet> or <xsl:transform> and needs to disambiguate them -- does such a process exist?


    • That won't work
      2005-04-27 08:31:06 EdSaltelli

      "For example, why not use a regular attribute on the root element to identify the "type" of the document, but without needing to propagate that attribute down to the child elements like a namespace. That would allow disambiguation while eliminating the scoping issues."


      This is possible today with the proper Schema definitions and attributes. By defining only one top level element and using setting the schema attribute elementFormDefault='unqualified'. All other elements would be defined w/in the scope of the global element; the default serialization of your XML document would not require all of the namespace prefixes on the elements.



Sponsored By: