Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Versioning of XML Schema and namespaces

From: Eliot Kimber <ekimber@---------------.--->
To: xmlschema-dev@--.---
Date: 5/12/2005 4:37:00 AM
Michael Kay wrote:
>>That's my reason for using the namespace with a version.
>>
>>I understand all the stated reasons for not doing this, but 
>>out of the box 
>>there is nothing else that will consistently and 
>>automatically trip up 
>>validation if I don't have the "right" file being used to validate my 
>>documents.
> 
> 
> You might make it easier for the recipient to do validation by including a
> version in the namespace, but you are making it hideously difficult for the
> recipient to process the incoming documents using namespace-aware tools such
> as XSLT and XQuery - as anyone who has tried to write code that handles the
> different flavours of RSS can tell you.

Yow! I completely forgot about this very practical reason for not 
versioning namespaces! This is really much more compelling than any 
philosophical argument I could make.

Mike is 100% correct--any namespace-aware processor, the most obvious 
example being XSLTs, may have to be significantly rewritten at the 
detail level in order to handle each new variant of the namespace for 
the same (abstract) application.

For example, consider this XSLT life cycle:

Time T[0]:

  - Application namespace is: xmlns:myns0="http://example.com/myns/v0"

  - Write template to match on element "foo" within "bar" in this namespace:

    <xsl:template match="myns0:bar/myns0:foo">

    (multiply by the number of element types in the application)

Time T[1]:

   - New version of the myns schema is released and the namespace is
updated to: xmlns:myns0="http://example.com/myns/v1"

   - Rewrite *each* template to reflect the new namespace and the old 
namespace:

    <xsl:template match="myns0:bar/myns0:foo | myns1:bar/myns1:foo">

    (multiply by the number of element types in the application)

  - Add any new templates for element types that are new (or in new 
contexts) for this new release of the application.


Clearly this represents a huge maintenance cost for any non-trivial 
application and processor that needs to support multiple versions of an 
application. And multiple by the number of namespaces used in a given 
application--if all of them version their namespaces it's going to be a 
real mess within a short period of time.

By contrast, if the namespace doesn't change, new versions of the schema 
require only adding the specific code needed to react to those changes, 
not a change to, potentially, every match= and select= statement in the 
transform.

And note that using matches of the form "*[name() = 'foo']" are not 
generally safe when processing documents that contain elements from 
different namespaces because there could easily be conflicts of local 
names (that being the whole motivation for namespaces in the first place).

Cheers,

Eliot
-- 
W. Eliot Kimber
Professional Services
Innodata Isogen
9390 Research Blvd, #410
Austin, TX 78759
(512) 372-8155

ekimber@i...
www.innodata-isogen.com


From dvint@d... Thu May 12 17:32:45 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent