Re: [xslt] problem with apply-templates



On Wed, Oct 17, 2001 at 08:41:01AM -0700, Daniel Allen wrote:
> I have seem to run in to a possible problem with
> apply-templates...if you change the document in which
> you are working, by doing something like this
> 
> <xsl:for-each select="common:node-set($mynodeset)">
>   <xsl:apply-templates select="current()">
>     <xsl:with-param name="foo">bar</xsl:with-param>
>   </xsl:apply-templates>
> </xsl:for-each>
> 
> <xsl:template match="mynode">
>   <xsl:param name="foo"/>
>   <xsl:value-of select="$foo"/>
> </xsl:template>
> 
> ...then, the value of $foo is empty...if you had not
> changed the document using the node-set function, it
> would have the value of 'bar'.  This strikes me as
> being a problem...regardless of the document, the
> params should get passed....quite obviously this
> didn't work either...for the params (note that I am
> getting the match, it is just that the params don't
> come with the match)..
> 
> <xsl:apply-templates
> select="common:node-set($mynodeset)">
>   <xsl:with-param name="foo">bar</xsl:with-param>
> </xsl:apply-templates>

  Hum, could you make a simple but complete pair of xsl/xml files
exhibiting the problem and put the bug on bugzilla.gnome.org . It
will make sure I don't forget about it, and that I won't have troubles
trying to reproduce the exact problem you're seeing.

  TIA,

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]