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

Re: Fwd: document() doesn't pick up a param

Subject: Re: Fwd: document() doesn't pick up a param
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 07 Sep 2000 21:53:31 +0100
Re: Fwd: document() doesn't pick up a param
Michael,

>The XSL statement "with-param" doesn't seem to be carried over to
processing of
>nodesets from "document(...)" calls.

When you use document(), it gives you the *root node* of the document
that's named.  So when you do:

<xsl:apply-templates select="document('incoming.xml')">
  <xsl:with-param name="blah" select="555"/>
</xsl:apply-templates>

you're applying templates to the root node (/) of 'incoming.xml'.  In your
case, you have no template that explicitly matches the root node, so the
built-in template matches instead:

<xsl:template match="*|/">
  <xsl:apply-templates />
</xsl:template>

You'll notice that the built-in template doesn't declare any parameters nor
pass any on within the xsl:apply-templates.  Essentially this means that
any parameters you pass in are ignored and forgotten, and therefore appear
not to be being passed.

Rather than applying templates to the root node of the document, you want
to apply templates to the document element ('matchme'):

<xsl:apply-templates select="document('incoming.xml')/matchme">
  <xsl:with-param name="blah" select="555"/>
</xsl:apply-templates>

I hope that helps,

Jeni

Jeni Tennison
http://www.jenitennison.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.