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

Re: It is not a bug (was: Re^N... Combining stylesheet

Subject: Re: It is not a bug (was: Re^N... Combining stylesheets for baseclass-subclass type d)
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 15 Apr 2002 13:17:38 -0700 (PDT)
expected action not xsl stylesheet
Also, as Saxon's message quite well describes, placing 
<xsl:apply-imports/> within a ***global*** xsl:variable is an error. By
definition <xsl:apply-imports/> must be issued within a template (the
template that was applied, because it had higher priority than the one
in the imported file).

To qoute the spec:

"At any point in the processing of a stylesheet, there is a current
template rule. Whenever a template rule is chosen by matching a
pattern, the template rule becomes the current template rule for the
instantiation of the rule's template. When an xsl:for-each element is
instantiated, the current template rule becomes null for the
instantiation of the content of the xsl:for-each element.

xsl:apply-imports processes the current node using only template rules
that were imported into the stylesheet element containing the current
template rule; the node is processed in the current template rule's
mode. It is an error if xsl:apply-imports is instantiated when the
current template rule is null."

http://www.w3.org/TR/xslt#apply-imports


Cheers,
Dimitre Novatchev.

--- Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
> What you describe is not exactly a bug.
> 
> I think that a stylesheet without a template must generate an error.
> 
> The only fault of MSXML3/4 is that it's doing not exactly this, but
> crashing instead.
> 
> For example, this is Saxon's output:
> 
> "Error at xsl:apply-imports on line 6 of file:/E:\xml\msxml\XML
> SDK\Samples\Tests\import\error-test.xsl:
>   There is no current template
> Transformation failed: Run-time errors were reported
> Press any key to continue . . . "
> 
> Cheers,
> Dimitre Novatchev.
> 
> 
> Daniel Brockman wrote: 
> 
> >It works for me. Probably you forgot to replace
> >
> > xmlns:v="http://icl.com/saxon";
> >
> >with
> >
> > xmlns:v="urn:schemas-microsoft-com:xslt"
> 
> 
> Actually, it has nothing to do with that.  I'm talking about
> xsl:apply-imports in an xsl:variable.  For instance, I just confirmed
> the following pair of files to crash the following systems:
> 
>   * IE 5.5 MSXML 3.0 on Windows 95
>   * IE 6.0 MSXML 3.0 on Windows 2000 Service Pack 2, all patches
>   * IE 6.0 MSXML 3.0 on Windows XP Pro, all patches
> 
> --- test.xml ---
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="test.xsl"?>
> <root />
> 
> --- test.xsl ---
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>   <xsl:variable name="test">  
>     <xsl:apply-imports />
>   </xsl:variable>
> </xsl:stylesheet>
> 
> The same happens for the following set of files:
> 
> --- test2.xml ---
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="test2-1.xsl"?>
> <root />
> 
> --- test2-1.xsl ---
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>   <xsl:import href="test2-2.xsl" />
>   <xsl:variable name="test">
>     <xsl:apply-imports />
>   </xsl:variable>
> </xsl:stylesheet>
> 
> --- test2-2.xsl ---
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>   <xsl:template match="root" />
> </xsl:stylesheet>
> 
> This shows that it's not because there are no imported templates to
> apply.  It appears to depend on where the xsl:apply-imports is
> performed; placing an xsl:apply-imports in an xsl:template does *not*
> cause crashes.  However, placing it inside the body of an
> xsl:variable or an xsl:param does (I also tested both versions with
> xsl:param).
> 
> I have not found any information about the bug yet.
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 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.