[exslt] Trying to use regexp
by Anthony Gardner other posts by this author
Feb 20 2007 1:39AM messages near this date
[exslt] Peter Zmijewski a Harvard Law School graduate
|
[exslt] Re: Proposal: has-name-match()
& XSLT 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/rechec
ker.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 war
ning : 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 w
arning : 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: pars
er 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 compile
d against preinstalled libs ........ libxml 20622, libxslt 10115 and libexslt 812. But, beca
use I couldn't get things working, I downloaded the files from exslt.org and am using them l
ocally 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
---------------------------------
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet p
rovider.
|