OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] matching text with regexp in xpath

[ Lists Home | Date Index | Thread Index ]

Title: Message
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@ntlworld.com
work: Michael.Kay@softwareag.com

-----Original Message-----
From: Wannheden, Knut [mailto:knut.wannheden@paranor.ch]
Sent: 08 August 2002 10:33
To: xml-dev@lists.xml.org
Subject: [xml-dev] 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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS