DOM/XSLT & func:script

J

JEDI_BC

hi,

I try hardly to use javascript functions in my XSL (exslt.org) using
DOM/XSL (libxslt). It works on sablotron but it is too slow and cost too
much cpu.

I am up to date on my software versions (under PHP):

domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20615
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.1.12
libxslt compiled against libxml Version 2.6.15
DOM/EXSLT enabled
libexslt Version 0.8.3

Here an example :

XSL file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" >
<xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:func="http://exslt.org/functions"
xmlns:gru="http://gru.fr/namespace"
extension-element-prefixes="func"
exclude-result-prefixes="gru">
<func:script implements-prefix="gru" language="javascript">
function foo() {
return "bar";
}
</func:script>
<xsl:template match="*">
<xsl:value-of select="gru:foo()"/>
</xsl:template>
</xsl:stylesheet>

XML file :
<?xml version="1.0" encoding="ISO-8859-1"?>
<FOO>
<TOTO>plop</TOTO>
</FOO>

Xsltproc.exe give me these errors :
xmlXPathCompOpEval: function foo not found
XPath error : Unregistered function
xmlXPathCompiledEval: evaluation failed
runtime error: file gru.xsl line 19 element value-of
xsltValueOf: text copy failed
no result for gru.xml

any idea ?

Thanks

JEDI_BC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top