[Home] [By Thread] [By Date] [Recent Entries]

  • To: "Wannheden, Knut" <knut.wannheden@p...>,<xml-dev@l...>
  • Subject: RE: matching text with regexp in xpath
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Thu, 8 Aug 2002 07:57:33 -0700
  • Thread-index: AcI+vqipnFkIVy9/Q5G3GxiVOB856QALQ8Qh
  • Thread-topic: matching text with regexp in xpath

It depends on what XSLT processor you are using to determine what extension functions are available to you or embedded scripting options you have. 

	-----Original Message----- 
	From: Wannheden, Knut [mailto:knut.wannheden@p...] 
	Sent: Thu 8/8/2002 2:32 AM 
	To: xml-dev@l... 
	Cc: 
	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 


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member