Re: [xsl] different versions of xmlns:foo are never usable together?

Subject: Re: [xsl] different versions of xmlns:foo are never usable together?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 14 Jul 2005 16:37:39 +0100
In your stylesheet you can declare
xmlns:food10="http://who/knows/Food/1.0";
xmlns:food11="http://who/knows/Food/1.1";

and then match on food10:recipe or food11:recipe as required, or 
food10:recipe | food11:recipe
if you require both.

> If I want version 2.0 of the 'food' namespace to accept
> everything 1.0 did, but also add stuff like <food:wine-suggestions/>, is
> it possible? 

Yes but generally speaking it's a _really_ bad idea to change namespace
when you version a language. Changing the namespace means changing the
name of _every_ element in the language, so no program accepting the ist
language will acept any of the new and vice versa (by default, obviously
it can be written to accept any two languages).

note
xhtml 1 and 1.1 share the smae namespace
 (xhtml 2.0 bizarely has a new one)
mathml 1, 1.1 and 2 all share a namespace
xslt 1 and 2 share a namespace
etc.

Despite the fact that doing it causes problems people do it anyway 9and
even argue it's a good idea:-) XPath 2 will add *:recepe as a
possibility to mean local-name recipe in any namespace, or in xpath 1
you can use *[local-name()='recipe'] or if you want to make it a bit
tighter 
*[local-name()='recipe' and starts-with(namespace-url(),'http://who/knows/Food')] 

If it is your own input language, consider keeping the namespace the
same and having a version="2" mandatory top level attribute.

for some different views on the theme:

http://www.w3.org/XML/2005/xsd-versioning-use-cases/

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread