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

RE: XSLT 2.0 *and* XSLT 1.0 validation -- how to?

Subject: RE: XSLT 2.0 *and* XSLT 1.0 validation -- how to?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 25 Oct 2004 07:38:40 +0100
xslt 2.0 transition
> So better to have the stylesheets as 1.0, but individual templates as 
> 2.0?
> 

If you want to develop a stylesheet that's capable of operating on a 1.0
processor but can also take advantage of 2.0 features when available, then I
would be inclined to put the 2.0-dependent parts in separate modules, and to
assemble the complete stylesheet from different combinations of modules in
the two cases. This isn't the only way of doing it - you could also exploit
1.0 forwards compatibility mode - but it's probably the cleanest.

If you're in transition from 1.0 to 2.0, and want to do the conversion one
small step at a time, but without a need to keep the stylesheet working
under 1.0, then there might be some sense in using the version="2.0"
attribute only around constructs that require (or have been converted to)
2.0. Unfortunately, though, the obvious place to put such a version
attribute is on the xsl:template elements, but 1.0 doesn't allow this - it
allows it only on the xsl:stylesheet element or on literal result elements.
So again, moving the 2.0 code into a separate module that you then include
might be a more workable solution.

Incidentally, we have recently changed the XPath rules so that backwards
compatibility mode really means what it says - if your stylesheet specifies
version="1.0", you now continue to get all the old XPath 1.0 quirks, for
example that ["4.0"<="4"] is true while ["4.0"<"4" or "4.0"="4"] is false.
Although this reduces the problem in moving from 1.0 to
2.0-in-compatibility-mode, it's not a panacea, because the same problems
still exist, you now get them when moving from 2.0-in-compatibility-mode to
"2.0 proper". This is particularly true for the introduction of string
comparisons, where the meaning of a construct like @price<@discount now
changes between 2.0-in-compatibility-mode and 2.0 proper.

Michael Kay

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.