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

[xsl] how to break into


Subject: [xsl] how to break <preformat> into <p>
From: "Joga Singh Rawat jrawat@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Mar 2015 10:54:10 -0000

Hi Guys,
We need a clue to break <preformat> into multiple paragraph. Using below xsl
we are not able to transform <bold>

Input
<preformat>
Line 1
Line <bold>2</bold>
Line 3
</preformat>

Required output
<programlisting>
<p>Line 1</p>
<p>Line <b>2</b></p>
<p>Line 3</p>
</programlisting>

XSL
<xsl:template match="preformat">
<programlisting>
 <xsl:for-each-group select="." regex="[\n\r]">
  <xsl:non-matching-substring>
   <p><xsl:value-of select="."/></p>
  </xsl:non-matching-substring>
 </xsl:for-each-group>
</programlisting>

Thanks in advance
...JSR


Current Thread
Keywords
xsl