xsl-list
[Top] [All Lists]

Re: [xsl] Line breaks

2007-11-05 23:38:32
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>