Subject: RE: Convert html:br to paragraphs
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 2 Jun 2005 04:09:48 +0100
|
If the br elements are all at the top level you can do
<xsl:for-each-group select="child::node()" group-starting-with="br">
<p><xsl:copy-of select="current-group()[not(self::br)]"/></p>
</xsl:for-each-group>
If not, it's much harder.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: gregor FELLENZ [mailto:gf_public@xxxxxxx]
> Sent: 01 June 2005 16:55
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Convert html:br to paragraphs
>
> hello,
>
> i have to convert <br/> structured html sites into documents with a
> paragraph structure.
>
> that means:
>
> <body>1. para is here <br/>
> 2. para is here and <b>bold</b> or another
> inline element </body>
>
> has to be:
>
> <p>1. para is here</p>
> <p>2. para is here and <b>bold</b> or another
> inline element</p>
>
> any ideas? i've tried a little with for-each-group but did not get any
> solution.
>
> maybe i google the wrong question but at the moment i'm helpless. i'll
> also happy with a link where i can help myself.
>
> thanks in advance
>
> gregor
> --
> enforce privacy - http://www.pgpi.org
> pgp key id: 0x7DBB8BA1 - http://pgp.mit.edu
>
> mailto:gf_public@xxxxxxx
> Mittwoch, 1. Juni 2005 16:52
|