Re: [xsl] passing parameters with apply-template and document()

Subject: Re: [xsl] passing parameters with apply-template and document()
From: Oleg Tkachenko <oleg@xxxxxxxxxxxxx>
Date: Fri, 08 Oct 2004 12:15:37 +0200
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


Current Thread