Subject: Re: [xsl] split string to whole words based on length From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Thu, 27 Apr 2006 09:13:24 +0100 |
On 4/26/06, David Carlisle <davidc@xxxxxxxxx> wrote: > > This fails for the input: > I'm a bit confused by that as the format you show (a set of word > elements) looks like the output not the input. My solution fails (or at > least isn't written to do anything useful) if any singleword is greater > than your length (as it wasn't in the problem description:-) > > If you clarify what the input is in this case (and what you want the > output to be) I'll see if I can tweak the regexp,... Yes sorry failed to mention the key point of length being 255 for this input: <words> <word>aaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> </words> Both yours and Dimitre's solution's produce 3 output elements: <words>aaaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaa,aaaaa aaaaaaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaa,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</words> <words>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</words> <words>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</words> ...but I think it should only be two (which is what mine produces): <word>aaaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaa,aaaaa aaaaaaaaaaaaaaaaaaaaaaa,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaa,aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> <word>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</word> (lengths are 211 and 117) I've checked a few times and I think thats right... sorry about not giving the required length to go with the sample input (it was after a long day...)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] split string to whole wor, David Carlisle | Thread | Re: [xsl] split string to whole wor, David Carlisle |
[xsl] Transforming Tables, Jeff Sese | Date | Re: [xsl] split string to whole wor, David Carlisle |
Month |