[Home] [By Thread] [By Date] [Recent Entries]
Hi David,
Thanks for your explanation. If I understood well, in my sample : <span class="bar">text4</span> <span class="bar">text5</span> The 2 spans elements would not have been considered adjacent beacause the indentation "create" (or "is") a (whitespace) text node inbetween. Actually, in my xhtml doc, spans are sometimes inline, sometimes not, and there might be spaces between them when inline. In xhtml spaces are important, i think you all now the rules : only one space is displayed even when there are more, and a line feed also generate one space on the display screen. So to be more generic and xhtml indentation/spaces aware, i would like such an input : <p id="foo"><span class="foo1">text1</span> <span class="foo1">text2</span> <span class="foo1">text3</span> <span class="foo2">text4</span> <span class="foo2">text5</span> <span class="foo2">text6</span><span class="foo1">text7</span> <span class="foo1">text8</span> </p> to be output like this : <p id="foo"><span class="foo1">text1 text2 text3</span> <span class="foo2">text4 text5 text6</span><span class="foo1">text7 text8</span> </p> I tried the same template as you David, with : <xsl:for-each-group select="node()" group-adjacent="string(@class) or normalize-space(.)=' '"> which doesn't group anything from my sample above. string(@class) is a string whereas normalize-space(.)=' ' is a boolean... so my test isn't good? I'm searching for a solution, any suggestions are welcome ! Matt Le 20/12/2010 21:40, David Carlisle a icrit : On 20/12/2010 17:47, Matthieu Ricaud-Dussarget wrote: -- Matthieu Ricaud IGS-CP Service Livre numirique
|

Cart



