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

Re: Parameter evaluation after use of document()

Subject: Re: Parameter evaluation after use of document()
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Mon, 29 Jul 2002 01:37:03 +0300
Re:  Parameter evaluation after use of document()
Yves Forkl wrote:

I am wondering why the XSLT code below doesn't work. Xalan-J dies with
the (not very helpful) errors mentioned below as soon as it tries to
get the value of "filename_base" in the second last line in the
stylesheet excerpt.

  <xsl:apply-templates
    select="document(concat($filename_base, '.xml'))"
    mode="info_mode">

Applying templates directly to a result of document() function can be dangerous sometime due to the fact that the result is always root node and template for "/" is in use. Without a mode it could cause infinite looping, in your case you probably don't have template for root node in info_mode mode and built-in template as usual loses your parameter.
Try to add some location path after document() function to eliminate built-in templates processing as they don't pass parameters.


<xsl:apply-templates
     select="document(concat($filename_base, '.xml'))/*"
     mode="info_mode">

But anyway it's perfectly legal xslt stylesheet and xalan shouldn't die on it, probably you have found a bug.

--
Oleg Tkachenko
Multiconn International, Israel


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.