By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,334 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,334 IT Pros & Developers. It's quick & easy.

EXSLT and regexp

P: n/a
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" />

<xsl:output 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
Jul 25 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.