[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: RegEx in XSLT?

Subject: RE: RegEx in XSLT?
From: "Mario Michlits" <mario.michlits@xxxxxxxx>
Date: Thu, 28 Mar 2002 18:23:29 +0100
xslt value of regex
Regexp-matching is not actually powerful with XSLT alone.
But there are a lot of possibilities concerning extension functions. The way of integrating them depends on the processor you are using.
Saxon for example can integrate java-functions somehow like this, by defining a namespace to a java class:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		version="1.0"
		xmlns:RegexpClass="http://www.jclark.com/xt/java/com.hico.onlaw.convert.RegexpClass">

Then in the stylesheet in which you use the functions you can define variables like: 

<xsl:variable name="RegexpFunction" select="RegexpClass:new()"/>

For example, one application of regexp-functions in my stylesheet looks like this:

<xsl:variable name="doknr">
        <xsl:if test="Regexp:matchRegex($RegexpFunction, ris.c/ris.c.doknr, '&ris.c.doknr;')">
                <r1>
                        <v1>
                                <xsl:value-of select="Regexp:getMatchRes($RegexpFunction, 1)"/>
                        </v1>
                        <v2>
                                <xsl:value-of select="Regexp:getMatchRes($RegexpFunction, 2)"/>
                        </v2>
                        <v3>
                                <xsl:value-of select="Regexp:getMatchRes($RegexpFunction, 3)"/>
                        </v3>           
       
                </r1>
        </xsl:if>
</xsl:variable>

Hope this was helpful input

regards
Mario

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • RegEx in XSLT?
    • Jakub . Valenta - Thu, 28 Mar 2002 11:26:03 -0500 (EST)
      • <Possible follow-ups>
      • Mario Michlits - Thu, 28 Mar 2002 12:21:40 -0500 (EST) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.