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

RE: xslt 2, forward compatibility mode.

Subject: RE: xslt 2, forward compatibility mode.
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 5 Mar 2003 02:17:06 -0000
msxml6
XSLT 2.0 allows the [xsl:]version attribute on any element. XSLT 1.0
allows it only on the xsl:stylesheet element or a literal result
element.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Brown
> Sent: 05 March 2003 01:30
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  xslt 2, forward compatibility mode.
> 
> 
> Michael Kay wrote:
> > Suppose that XSLT 3.0 has just been published, and it 
> includes a new 
> > <xsl:perform-magic> instruction, which is implemented in 
> Saxon version 
> > 19.2, but not yet in MSXML6. You want to invoke this 
> instruction when 
> > your stylesheet is running under Saxon, but when running 
> under MSXML6, 
> > you just want to leave out that part of the output. So you write:
> > 
> > <xsl:template match="thing" version="3.0">
> >   <xsl:perform-magic select="magic-dust">
> >     <xsl:fallback>Sorry, Microsoft don't do magic</xsl:fallback>
> >   </xsl:perform-magic>
> > </xsl:template>
> > 
> > Specifying version="3.0" means that the Microsoft processor (or any 
> > XSLT 1.0 or 2.0 processor) is obliged to execute the xsl:fallback 
> > instruction. If you had said version="1.0" or 
> version="2.0", then the 
> > processor would instead have thrown a static error saying 
> that there 
> > is no such instruction as xsl:perform-magic.
> 
> That does not work.
> 
> % cat fallback.xsl
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
>   <xsl:output method="xml" indent="yes"/>
> 
>   <xsl:template match="/" version="3.0">
>     <result>
>       <xsl:perform-magic select="magic-dust">
>         <xsl:fallback>Sorry, we don't do magic</xsl:fallback>
>       </xsl:perform-magic>
>     </result>
>   </xsl:template>
> 
> </xsl:stylesheet>
> 
> % saxon dummy.xml fallback.xsl
> Error at xsl:template on line 7 of 
> file:/opus/home/mike/xml/test/fallback.xsl:
>   Attribute 
> version is not allowed on this element
> Error at xsl:perform-magic on line 9 of 
> file:/opus/home/mike/xml/test/fallback.xsl:
>   Unknown XSLT 
> element: perform-magic
> Transformation failed: Failed to compile stylesheet. 2 errors 
> detected.
> 
> Mike
> 
> -- 
>   Mike J. Brown   |  http://skew.org/~mike/resume/
>   Denver, CO, USA |  http://skew.org/xml/
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.