While Namespaces in XML continues to periodically surprise developers with new questions, Tom Bradford has offered a "clean" approach to namespace handling.
Clean XML Namespaces starts with a slightly different set of priorities than Namespaces in XML:
"It is not meant to be a specification that would require additional APIs, and it is not meant to replace formal namespaces. The objective is to define a simple way to non-invasively represent XML namespaces with simple qualified naming patterns."
Clean namespaces use a lexical approach to identifying namespaces rather than requiring processors to map prefixes to namespaces values defined in attributes. While the amount of information to be stored in prefix is somewhat verbose, Bradford notes that "terseness is not what XML is about."
Like Namespaces in XML, the namespace identifier is set off from the local name using a colon, but the namespace information is contained in the prefix itself, rather than in a mapping to a separate URI declaration. These prefixes may optionally be given declarations conforming to Namespaces in XML, allowing both approaches to operate simultaneously.
Related stories:
|