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

Re: xslt 2, design patterns

Subject: Re: xslt 2, design patterns
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Oct 2004 11:52:37 +0100
big regexp
  Readability David?

beauty is in the eye of the beholder...

    regex's look pretty horrendous sometimes, 
  but I guess it would work if they were in variables.

Actually if you are matching the whole string I would use an xsl:choose
with matches() as Michael showed.

The main advantage in pushing them all into a single big regexp 
is if you are using it with analyze-string and you want to match all
occurrences of any of the regexps. 

If you do it all in one go it looks a bit horrendous but actually works
quite simply, if on the other hand you do it "one at a time" then after
the first case your original string already has some element nodes
coming from the earlier replacements (or depending how you iterate) you
are just handling the non matching fragments not the entire string.

See for example the big regexp in my htmlparse stylesheet that I think
you cite in your xslt2 faq area.

David



________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

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
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.