Re: [xslt] exslt functions problem



Hi again,

I asked on the exslt list and it appears that the files below run
fine on Saxon and have no syntax problems. They also work on libxslt
if include is used instead of import, so it is a libxslt-specific bug
when import is combined with exslt functions. I'll dig around and see if I
can work out what it is, but since I don't know the code this may take
some time... ;-)

Graham

On Sun, 3 Mar 2002, Graham Seaman wrote:

> Given the two files below, if I run the second one free-standing
> everything works fine (though I found I needed to include the
> line
> extension-element-prefixes="func"
> which I thought shouldn't be necessary - I don't know if this is related).
> 
> If I call the second file from the first, it fails with the error
> messages:
> >
> xmlXPathCompOpEval: function testfunc not found
> Error xpath.c:9306: Unregistered function
> xmlXPathCompiledEval: evaluation failed
> runtime error: file test2.xsl element value-of
> xsltValueOf: text copy failed
> 
> When I put a fprintf in libxml hash.c xmlHashAddEntry3() to show the
> values name, name2, name3 being passed for registering I see among other
> things: 
> http://exslt.org/functions,(null),(null)
> http://opencollector.org/functions,testfunc,(null)
> 
> so it does appear to be registered.
> Changing the namespace so that my function is in the 'func' namespace
> instead of 'ocfunc' doesn't change anything.
> 
> Can anyone tell me what I'm doing wrong?
> Thanks
> Graham
> 
> ----------------------------------------------------------------
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
> version="1.0"
> xmlns:ocfunc="http://opencollector.org/functions";
> >
> <xsl:import href="test.xsl"/>
> 
> <xsl:template match="/">
>  <xsl:value-of select="ocfunc:testfunc()"/>
> </xsl:template>
> 
> </xsl:stylesheet>
> -------------------------------------------------------------------------
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
> version="1.0"
> xmlns:func="http://exslt.org/functions";
> xmlns:ocfunc="http://opencollector.org/functions";
> extension-element-prefixes="func"
> >
> 
> <func:function name="ocfunc:testfunc">
>   <func:result select="99"/>
> </func:function>
> 
> <xsl:template match="/">
>  <xsl:value-of select="ocfunc:testfunc()"/>
> </xsl:template>
> 
> </xsl:stylesheet>
> ---------------------------------------------------------------------------
> 
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt
> 




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