|
Subject: RE: [xsl] problem using dyn:evaluate with MSXML From: "Matthieu Ricaud" <matthieu.ricaud@xxxxxxx> Date: Thu, 16 Dec 2004 16:08:53 +0100 |
Hello,
I use Jeni Tennison's code given in a thread to implement an evaluate()
fonction :
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
extension-element-prefixes="dyn msxsl">
<msxsl:script implements-prefix="dyn" language="jscript">
function evaluate(context, expression)
{
return context.nextNode().selectNodes(expression);
}
</msxsl:script>
...
</xsl:stylesheet>
I define a variable $y containing an Xpath expression laike this :
<xsl:variable name="y" select"'@my_attribute'">
Calling
<xsl:value-of select="dyn:evaluate(., $y)"/>
works fine and give me the attribute value.
The problem I have is that when I define $y like this :
<xsl:variable name="y">@num</xsl:variable>
(Which is to me exactly the same definition as before)
then I get a error !
The HTML page cannot be loaded. The message error is in French :
"Type d'erreur :
msxml3.dll (0x80020009)
Erreur d'exicution Microsoft JScript Type incompatible ligne = 4, col = 10
(la ligne est dicalie ` partir du dibut du bloc de script).
Erreur renvoyie par l'appel de mithode ou de propriiti."
My XML parser is MSXML3
XML/XSL to HTML transform is performed with asp vb script using DOM
$y is calculated so I cannot write it directly within the "select". It can
be any Xpath (not only attribute name, so I can't use local-name()=$y)
As somebody Ideas about this ?
Matthieu.
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] grouping confusion, Bruce D'Arcus | Thread | Re: [xsl] problem using dyn:evaluat, David Carlisle |
| [xsl] grouping confusion, Bruce D'Arcus | Date | Re: [xsl] problem using dyn:evaluat, David Carlisle |
| Month |