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

Re: including an XSLT 1.0 stylesheet in a XSLT 2.0 one

Subject: Re: including an XSLT 1.0 stylesheet in a XSLT 2.0 one
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 05 Jan 2012 22:04:14 +0000
Re:  including an XSLT 1.0 stylesheet in a XSLT 2.0 one
On 05/01/2012 21:03, TW wrote:
I suspect that Saxon treats stylesheets that have the version
attribute set to 1.0 and are imported into 2.0 stylesheets as if they
actually were 2.0 stylesheets.  Is that right?

no, you can place version= attribute on any xsl element (or xsl:version attribute on literal result elements) and the effective value for any xpath expression is the value on the nearest ancestor, thus expressions in the included stylesheet will be evaluated in backwards compatibility mode in this case.


back to the original question

I'm wondering whether it
makes sense to develop part of my stylesheets in 1.0 to leave the door
open for using them both client and server side.

There can be some confusing side effects from mixing versions, with identical expressions behaving differently depending.., I think it's probably better to stick version=2 on them all so you get consistent behaviour. You can still use the styelsheets in an xslt 1.0 system on a browser, the forward-compatible processing that happens in that case is specified, so as long as the included modules don't use 2.0 features there is no problem using then in a browser even if they say version="2.0".


David

--
google plus: https:/profiles.google.com/d.p.carlisle

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.