ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> exslt
exslt
[exslt] Tryin to use regexp
by Anthony Gardner other posts by this author
Mar 8 2007 12:44AM messages near this date
[exslt] Path error in date/functions/format-date/date.format-date.function.xsl | Re: [exslt] Tryin to use regexp
& XSLT I posted this is February but had no reply so am trying again as the list seems to ha
ve 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/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
 		
---------------------------------
 All New Yahoo! Mail � Tired of unwanted email come-ons? Let our SpamGuard protect you.
Thread:
Anthony Gardner
A. Pagaltzis

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved