bsuh / node_xslt

a simple XSLT addon for node
zlib License
71 stars 17 forks source link

using exslt functions #13

Closed dimik closed 9 years ago

dimik commented 12 years ago

I try to use regex exslt extension and get an error

xmlXPathCompOpEval: function test not found
XPath error : Unregistered function
xmlXPathCompiledEval: 3 objects left on the stack.
runtime error: file ymapsml.xsl line 19 element value-of
XPath evaluation returned no result.

All namespases and extension-element-prefixes are present

  1 <?xml version="1.0"?>                                                                                                                                                                          
  2 <xsl:stylesheet version="1.0"
  3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4     xmlns:exsl="http://exslt.org/common"
  5     xmlns:re="http://exslt.org/regular-expressions"
  6     extension-element-prefixes="exsl re">
  7 

...

 17     <xsl:template match="*">
 18         <xsl:text>{</xsl:text>
 19         <xsl:value-of select="re:test(string(.), 'no', 'g', 'yes!!!')" />
bsuh commented 12 years ago

Looks like libxslt, which node_xslt is a wrapper around, doesn't support regular expressions.

dimik commented 11 years ago

do you know how can i fix it?