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

Re: matching text with regexp in xpath


xpath regexp
Title: Message
If you want "replace" functionality, you could wrap the Jakarta ORO package as Java Extensions in your XSLT code. We found the behavior of the regexp JDK 1.4 to be erratic.  Either the ORO or the Regexp Package from the apache foundation are pretty solid, specially if you want compatibility with Perl syntax.
 
http://jakarta.apache.org/oro
http://jakarta.apache.org/regexp
 
Please keep us informed of your progress. We're working on Regexp support for XSLT ourselves.
 
Juan Estevan Madrigal
Business Orchestration Services, inc.
----- Original Message -----
Sent: Thursday, August 08, 2002 5:55 AM
Subject: RE: matching text with regexp in xpath

This will be available in XPath 2.0. It's not difficult to do by writing extension functions, using any of the Java processors together with the regex libraries in JDK 1.4, especially if all that you want is a boolean "match" function.
 

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s...

-----Original Message-----
From: Wannheden, Knut [mailto:knut.wannheden@p...]
Sent: 08 August 2002 10:33
To: xml-dev@l...
Subject: matching text with regexp in xpath

Hi,

I was wondering if anybody knows of an extension function to XPath which allows me to match text and attribute values in XML documents against regular expressions.  I'd like to be able to write something like:

        /a/b[re:match(@c, '{.}')]

to match all elements where an attribute has a value matching the regexp {.} (AVT) or:

        /a/b/@c[re:match(., '{.}')]

to match the attribute elements themselves.

If there isn't such a thing yet I imagine it shouldn't be to hard to write.  Can somebody give me some hints/directions on how to get started with this?

Thanks,

--
knut


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.