Tryin to use regexp
Anthony Gardner <[email protected]> Thu, 8 Mar 2007 08:43:56 +0000 (GMT)
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Message-ID | <[email protected]> |
I posted this is February but had no reply so am trying again as the list seems to have reawoken.......
I'm sure this isn't the first post about this but I have googled and written to other people but nothing has given me the difinitive solution.
Firslty, I tried an example form the exslt web site
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:regexp="http://exslt.org/regular-expressions"
extension-element-prefixes="regexp">
<xsl:import href="/home/anthony/downloads/exslt/orig_exslt/regexp/regexp.xsl" />
<xsl:template match="/">
<xsl:for-each select="regexp:match('http://www.bayes.co.uk/xml/index.xml?/xml/utils/rechecker.xml', '(\w+):\/\/([^/:]+)(:\d*)?([^# ]*)')">
Part <xsl:value-of select="position()" /> = <xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
and using xsltproc, I get ...........
/home/anthony/downloads/exslt/orig_exslt/regexp/regexp.xsl:2: parser warning : xmlns:regexp: 'http://exslt.org/Regular Expressions' is not a valid URI
w.w3.org/1999/XSL/Transform" xmlns:regexp="http://exslt.org/Regular Expressions"
^
/home/anthony/downloads/exslt/orig_exslt/regexp/functions/test/regexp.test.xsl:2: parser warning : xmlns:regexp: 'http://exslt.org/regular expressions' is not a valid URI
"http://exslt.org/functions" xmlns:regexp="http://exslt.org/regular expressions"
^
/home/anthony/downloads/exslt/orig_exslt/regexp/functions/match/regexp.match.xsl:2: parser warning : xmlns:regexp: 'http://exslt.org/regular expressions' is not a valid URI
"http://exslt.org/functions" xmlns:regexp="http://exslt.org/regular expressions"
^
/home/anthony/downloads/exslt/orig_exslt/regexp/functions/replace/regexp.replace.xsl:2: parser warning : xmlns:regexp: 'http://exslt.org/regular expressions' is not a valid URI
"http://exslt.org/functions" xmlns:regexp="http://exslt.org/regular expressions"
^
xmlXPathCompOpEval: function match not found
XPath error : Unregistered function
xmlXPathCompiledEval: 1 object left on the stack
So, I renamed the exslt regexp namespaces to regular-expressions and now I just get ..............
xmlXPathCompOpEval: function match not found
XPath error : Unregistered function
xmlXPathCompiledEval: 1 object left on the stack
Now, there are several things. I'm using xsltproc on Ubuntu which I believe has been compiled against preinstalled libs ........ libxml 20622, libxslt 10115 and libexslt 812. But, because I couldn't get things working, I downloaded the files from exslt.org and am using them locally with the preinstalled xsltproc.
Is that causing conflicts?
I'd really like to get this working to use at work. It'll save a lot of hassle if I do.
I'd like to think I don;t need hand-holding but any pointers in the right direction would be great.
-Ants
---------------------------------
All New Yahoo! Mail Tired of unwanted email come-ons? Let our SpamGuard protect you.
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list