xsl-list
[Top] [All Lists]

RE: passing parameters with apply-template and document()

2004-10-08 03:58:19
Sorry I missed that! I'm getting too accustomed to XSLT 2.0, where built-in
templates *do* pass the parameters through.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Oleg Tkachenko [mailto:oleg(_at_)tkachenko(_dot_)com] 
Sent: 08 October 2004 11:16
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] passing parameters with apply-template and 
document()

Robert McGrath wrote:

      <xsl:apply-templates select="document('docB.xml')">
        <xsl:with-param name="paramB" select="$paramA"/>
      </xsl:call-template>

Beware that document() function returns root node (not to be confused 
with outermost element node). So you are applying templates 
to the root 
node of the docB.xml and if you don't have a template that 
matches "/" 
or "node()", built-in template for a root node will be used. 
And as all 
built-in templates it doesn't pass parameters through.
Use <xsl:apply-templates select="document('docB.xml')/*">
-- 
Oleg Tkachenko
http://blog.tkachenko.com
Multiconn Technologies, Israel


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>