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

Re: Grouping by character runs (and keeping element s

Subject: Re: Grouping by character runs (and keeping element structure)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 27 Jul 2006 11:50:46 +0100
Re:  Grouping by character runs (and keeping element  s
> Is there a certain pattern on how to tackle these kind of problems in
> XSLT, or is the language just not the tool of choice for this kind of
> transformation?

last time this came up on this list (a while ago, not sure I could find
it in the archives)  two solutions were proposed (one from Mike and one
from me, so that made a change:-) they were radically different.

I made a pre-pass that flattened all the markup in the paragraph to text
so there was a single text node that could be handled with
analyze-string, then did a final pass that handled each remaining text
node with analyze-string to put the markup back.

Mike did a pre-pass to tokenize the original text node and wrap every
word in an element (as I recall) then use xsl:for-each-group to add your
grouping element (<marker> in your case) then did a final pass taht
unwrapped the tokenized  words back into larger text nodes.


Current Thread


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.
First Name
Last Name
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.