September 29, 2002
@ 12:58 AM
What are XML Namespaces?

First some background, an XML namespace is a collection of names, identified by a Uniform Resource Identifier (URI) reference, which are used in XML documents as element and attribute names. XML namespaces provide a mechanism in which elements and attributes within an XML document from different markup vocabularies can be unambiguously identified and combined without processing problems ensuing. Thus the W3C XML namespaces recommendation provided a method for partitioning various items within an XML document based on processing requirements without placing undue restrictions on how these items should be named.

For more information on XML Namespaces than you probably care about you can read my first Extreme XML column on MSDN.

#

Barking Up The Wrong Tree

Winer's comments about RSS aggregators that couldn't handle new RSS feeds which added an XML namespace declaration to the root element shows a fundamental lack of understanding of how namespace aware processing works. In fact, for an RSS agregator to be broken by the addition of a default namespace declaration on the root element is an indication of the fact that the XML parser used supports namespaces and not the opposite as Dave Winer posits. To a non-namespace aware processor the default namespace declaration is just another attribute which can be ignored or not depending on how the application was written. On the other hand, to a namespace aware processor this effectively renames every element in the document.

Reading the original blog entry by Winer about the broken aggregators I noticed a reference to Ovidiu Predescu aggregator being broken. A quick look at Ovidiu Predescu's aggregator shows that he is using Saxon and XSLT as his XML parser and application language respectively. Saxon is a namespace aware parser and XSLT is a technology that supports XML namespaces.

So Dave Winer came to the wrong conclusion as to the source of the issue by not adequately researching the problem or examining the facts.

#

Versioning and XML Namespaces

The broken RSS aggregators highlight a problem with versioning and namespace aware processing of XML documents. Any change in the namespace of the elements or attributes in an XML document will break all namespace aware processors that consume XML in that format. For example all XML namespace aware processors which consume SOAP 1.1 messages will probably not be able to consume SOAP 1.2 messages without a rewrite. This is clearly stated in the SOAP Versioning Model in the current SOAP 1.2 working draft.

Many have argued that this indicates a need to use version attributes on the root element as a versioning mechanism instead which is the route taken by XSLT.

I am somewhat in the middle and my opinion on versioning and XML vocabularies is available in the W3C Technical Architecture Group archives.

The entire thread is actually good reading.

#

 

Categories:

Comments are closed.