Re: [xsl] Regex string function question

Subject: Re: [xsl] Regex string function question
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Wed, 24 Jan 2001 08:43:36 +0100
Nic,

Miloslav Nic wrote:
> 
> If it had my dream would come true.
> But unfortunately they do not appear in XSLT 1.1 proposal.
> What a pity.

It's also one of my dreams and I am sure we are not the only ones.

Why won't us put a prosal for a standardised extension ?

More precisly, my dream takes the form of functions taking a string (or
a XPath expression ?) and a regular expression as parameters and
returning a node set with the results.

Borowing an exemple from the PHP manual [1]:

preg_match_all("Call 555-1212 or 1-800-555-1212 or (612) 555-1313", 
	"/\(? (\d{3})? \)? (?(1) [\-\s] ) \d{3}-\d{4}/x")

would return a nodeset whose structure could be:

<matches>  <!-- maybe we don't need a document element here ? -->
 <match>
  <part>555-1212</part>
 </match>
 <match>
  <part>1-800-555-1212</part>
 </match>
 <match>
  <part>(612) 555-1313</part>
 </match>
</matches>

What do you think ?

Eric

[1] http://www.php.net/manual/en/function.preg-match-all.php

> --
> ******************************************
> <firstName> Miloslav </firstName>
> <surname>   Nic      </surname>
> 
> <mail>    nicmila@xxxxxxxxx    </mail>
> <support> http://www.zvon.org  </support>
> <zvonMailingList>
>     http://www.zvon.org/index.php?nav_id=4
> </zvonMailingList>
-- 
------------------------------------------------------------------------
Eric van der Vlist       Dyomedea                    http://dyomedea.com
http://xmlfr.org         http://4xt.org              http://ducotede.com
------------------------------------------------------------------------

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


Current Thread