[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] xslt 2, design patterns
Subject: Re: [xsl] xslt 2, design patterns From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 4 Oct 2004 11:52:37 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xslt 2, design patterns, Pawson, David | Thread | [xsl] send overflow to row below, James Steven |
RE: [xsl] xslt 2, design patterns, Pawson, David | Date | [xsl] send overflow to row below, James Steven |
Month |