Subject: Re: Dynamic dispatch of functions/templates (was matching text() )
From: Piet van Oostrum <piet@xxxxxxxxxxxxxx>
Date: Fri, 7 Jan 2011 18:06:16 -0400
|
iwanttokeepanon wrote:
> Can I ask a question (it may be stupid), if that is the only thing
> you are trying to do then isn't that easy? E.g.:
>
> XML: <root> <a>first-text <b>second-text</b> </a> </root>
>
> XSL: <xsl:template
> match="text()[parent::b[parent::a[parent::root]]]">
> text=<xsl:value-of select="." /> </xsl:template>
>
> Ok, there is probably a more elegant way to express that but it
> works, right? Or did I miss something in the talk about multiple
> text nodes?
Why not write <xsl:template match="/root/a/b/text()"> ?
Or <xsl:template match="root/a/b/text()"> if that is more appropriate ?
--
Piet van Oostrum
Cochabamba. URL: http://pietvanoostrum.com/
Nu Fair Trade woonartikelen op http://www.zylja.com
|