[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: Fri, 06 Jan 2012 12:56:26 +0000
Re:  including an XSLT 1.0 stylesheet in a XSLT 2.0 one
On 06/01/2012 12:03, TW wrote:
Thanks Michael and David.


Do I understand this correctly: all XPath expressions inside an
element with version="1.0" are interpreted as XPath 1.0, even if the
enclosing elements have (or inherit) version="2.0".

they are evaluated as xpath2 in backwards compatibility mode (which is almost, but not quite the same as xpath 1) similarly all xsl instructions (notably xsl:value-of) are evaluated in xsl backward compatibilty mode.


(The other way
round, using the version attribute on an element inside a 1.0
stylesheet doesn't seem to be valid.)

xsl only allowed version on xsl:stylesheet so you can't nest at arbitrary points, but the original example of having different version= on different stylesheet modules being imported or included applies to xslt 1 as well.


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".


So the benefit of putting version="2.0" on the imported stylesheets is that it guarantees I have XPath 2.0 only, and if they are imported by XSLT 1.0, they'll be handled in forward compatibility mode (XPath 1.0).

Thomas W.


yes


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.