6

Has anyone got Regexp working in libxslt? When yes, how?

http://www.exslt.org/regexp/index.html

When using the command xsltproc --dumpextensions with the latest libxslt I'm not getting any Regexp support :-(

Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
therealmarv
  • 3,692
  • 4
  • 24
  • 42
  • Joel Reed has written a libxslt-plugin for handling also regex in XSLT. Links are here: [filewatcher](http://www.filewatcher.com/m/libxslt-plugin-regexp-0.3.tar.gz.281265.0.0.html) or here [at xmlsoft.org](ftp://xmlsoft.org/libxml2/plugins/libxslt-plugin-regexp-0.3.tar.gz) . But I have not tested them yet. Seems the development has been stopped for them ?! – therealmarv Aug 24 '11 at 10:50

1 Answers1

1

xsltproc includes {http://exslt.org/strings}replace already these days. Bind some prefix to that namespace, e.g. string, and then call string:replace().

You can get the list of extensions compiled into the xsltproc program using the shell command:

xsltproc --dumpextensions

If your libxsltproc is from the same build it should have the same extensions, I think.

barefootliam
  • 619
  • 3
  • 7
  • 4
    yes, but http://www.exslt.org/str/functions/replace/index.html does not has the same power as regular expressions. – therealmarv Feb 02 '13 at 19:31