C
Chris Croughton
I'm trying to use the EXSLT regexp package from
http://www.exslt.org/regexp/functions/match/index.html
(specifically the match function) with the libxml xltproc (which
supports EXSLT), but whatever I do gets errors. The examples use
namespace regExp, but the supplied files use regexp, I've got it so that
it at least doesn't complain about namespaces but it then complains that
it can't find the match function. My stylesheet is:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:func="http://exslt.org/functions"
xmlns:regexp="http://exslt.org/regular-expressions"
extension-element-prefixes="regexp"
<import href="regexp.match.xsl" />
<xslutput method="text"/>
<xsl:template match="/">
<xsl:for-each select="regexp:match('This is a test string', '(\w+)', 'g')">
Part <xsl:value-of select="position()" /> = <xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
(This is the same test as the second one on the page referenced above,
with regExp changed to regexp and the closing parenthesis added.)
The errors I get are:
xmlXPathCompOpEval: function match not found
Error xpath.c:9637: Unregistered function
xmlXPathCompiledEval: 2 object left on the stack
Has anyone actually had the regexp functions working?
Chris C
http://www.exslt.org/regexp/functions/match/index.html
(specifically the match function) with the libxml xltproc (which
supports EXSLT), but whatever I do gets errors. The examples use
namespace regExp, but the supplied files use regexp, I've got it so that
it at least doesn't complain about namespaces but it then complains that
it can't find the match function. My stylesheet is:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/XSL/Transform"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:func="http://exslt.org/functions"
xmlns:regexp="http://exslt.org/regular-expressions"
extension-element-prefixes="regexp"
<import href="regexp.match.xsl" />
<xslutput method="text"/>
<xsl:template match="/">
<xsl:for-each select="regexp:match('This is a test string', '(\w+)', 'g')">
Part <xsl:value-of select="position()" /> = <xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
(This is the same test as the second one on the page referenced above,
with regExp changed to regexp and the closing parenthesis added.)
The errors I get are:
xmlXPathCompOpEval: function match not found
Error xpath.c:9637: Unregistered function
xmlXPathCompiledEval: 2 object left on the stack
Has anyone actually had the regexp functions working?
Chris C