|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Dynamicaly applying templates from a node-set containi
Hello, I'm using msxml, which has no evaluate() function. So I use a javascript extension fonction to it with the namespace xmlns:dyn="http://exslt.org/dynamic" found at http://www.xmleverywhere.com/tips/xslt.htm . Example of use : im my xml /foo/@bar has the value "hello" in my xsl i do : <xsl:variable name="var" select="'/foo/@bar'"/> <xsl:value-of select="dyn:evaluate(.,$var)"/> I get "hello" as result. (I wrote "absolute" xpath in this example so that the context doesn't matter) I often use this without problems (as well for applying template) but this time i have one... This time the variable to be evaluated is extracted from a node-set variable in my xsl : The node-set variable looks like follow : <xsl:variable name="NodeSetXpathExpressions"> <xpath>/foo/bar[1]</xpath> <xpath>/foo/bar[2]</xpath> <xpath>/foo/bar[3]/baz[1]</xpath> </xsl:variable> each xapth expression is "abslolute" (starts with /root_element_name) (this variable is generated in the xsl from the string "/foo/bar[1], /foo/bar[2], /foo/bar[3]/baz[1]" passed as parameter to the xsl) And now I want to apply templates for each <xpath> of the $NodeSetXpathExpressions variable, I wrote : <xsl:for-each select="msxsl:node-set($NodeSetXpathNode)/xpath"> <xsl:variable name="xpathValue" select="."/> <xsl:apply-templates select="dyn:evaluate(.,$xpathValue)"/> </xsl:for-each> I get an error... I think it is because of the context node, which is the matched <xpath> node within the for-each element, so I wrote <xsl:apply-templates select="dyn:evaluate(/,$xpathValue)"/>, hopping the context node would be the root element of the xml from wich the apply-template make sens, but I also get the same error. I also tried : <xsl:apply-templates select="dyn:evaluate(/foo,$xpathValue)"/> <xsl:apply-templates select="dyn:evaluate(current(),$xpathValue)"/> with no success... Has someone any idea ? Thanks ! Matthieu.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








