[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Versioned Namespaces

Subject: Re: Versioned Namespaces
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 15 Jul 2010 10:26:45 +0100
Re:  Versioned Namespaces
On 15/07/2010 09:58, Andy Chambers wrote:
Hi,

I've developed a small library of re-usable functions for working with
an clinical data XML standard.  The
standard has been around for a while now and so there are multiple
versions of it, each one of which
has a slightly different namespace

http://www.cdisc.org/ns/odm/v1.2
http://www.cdisc.org/ns/odm/v1.3

are the two I work with most commonly.

My library was developed against v1.3 and so uses this for the
namespace but now I need to make it
work when operating on a v1.2 documents.  Is there a way to do this
without code duplication?

Cheers,
Andy


The usual advice is don't change namespaces ever. If you change the namespace then you have changed the name of every construct in the language so it's not a new version, it's a completely new language.
(See how xslt 1 and 2 have the same namespace, as does mathml 1 2 3 )


Despite that it is regrettably common that people do use namespace changes as versioning.

the simplest way to handle that in xslt is to write the main code just using one namespace (say the new one) and then handle any document in the old namespace by first processing it in a mode that uses a single modified identity template that just switches the namespace., save that result to a variable, then apply your main processing mode to this modified in memory document tree.

David


________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.