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 >> xml-dev
xml-dev
Re: [xml-dev] matching text with regexp in xpath
by Uche Ogbuji other posts by this author
Aug 10 2002 2:52AM messages near this date
Re: [xml-dev] matching text with regexp in xpath | RE: [xml-dev] XHTML 2.0 and the death of XLink and XPointer?
>  ------_=_NextPart_001_01C23EBE.9040997A
>  Content-Type: text/plain;
>  	charset="iso-8859-1"
>  
>  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?

It depends on your XSLT processor.  4Suite comes with this built in.  It's 
called "f:match".


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One Boston: http://www.xmlconference.com/
Basic XML and RDF techniques for knowledge management, Part 7 - 
http://www-106.ibm.com/developerworks/xml/library/x-think12.html
Keeping pace with James Clark - http://www-106.ibm.com/developerworks/xml/libra
ry/x-jclark.html
Python and XML development using 4Suite, Part 3: 4RDF - 
http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle/8A
1EA5A2CF4621C386256BBB006F4CEC



-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org> , an
initiative of OASIS <http://www.oasis-open.org> 

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl> 

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved