[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Line breaks


Subject: Re: [xsl] Line breaks
From: Jeff Sese <jsese@xxxxxxxxxxxx>
Date: Tue, 6 Nov 2007 14:41:20 +0800

In XSLT 2.0 you can use xsl:analyze-string, something like:

<xsl:template match="pre">
	<xsl:analyze-string select="." regex="[\n\r]">
		<xsl:non-matching-substring>
			<p><xsl:value-of select="."/></p>
		</xsl:non-matching-substring>
	</xsl:analyze-string>
</xsl:template>

-- Jeff

On 11 6, 07, at 2:24 PM, J. S. Rawat wrote:

Hi all,
Can we put tags between line breaks. May be this looks simple but it defficult for me.


Input
<pre>
line1
line2
</pre>

Output
<p>line1</p>
<p>line 2</p>

thanks
...JSR


Jeferson L. Sese jsese at asiatype dot com Asiatype Incorporated Suite 114 Columbia Tower, Ortigas Ave. Greenhills, Mandaluyong City 1550 Philippines


Current Thread
Keywords