[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Can I make a XSLT not resolve CDATA sections for programlisting?
On Mon, Aug 25, 2003 at 01:17:35PM -0400, Taro Ikai wrote: > > In general, an XSLT processor does not preserve > > CDATA section markup. There is one escape feature, though. > > Your only hope is to include this in a customization layer: > > > > <xsl:output cdata-section-elements="programlisting"/> > > > > And change the processing of programlisting to > > just copy out the programlisting element: > > > > <xsl:template match="programlisting"> > > <xsl:copy-of select="."/> > > </xsl:template> > > This is just what I needed. Thanks. > > One additional wish is to let it produce: > > <programlisting><![CDATA[int foo; > foo++; > ]]></programlisting> > > instead of: > > <programlisting><![CDATA[ > int foo; > foo++; > ]]></programlisting> > > Please note the lack of line break at the beginning of the CDATA section > in the earlier block. > > Is there a way to do this? Your original programlisting had that line break right after the <programlisting> start tag: <programlisting> <![CDATA[int foo = 0; foo++; ]]> The processor is just preserving the first line break, but this time inside the CDATA section. -- Bob Stayton 400 Encinal Street Publications Architect Santa Cruz, CA 95060 Technical Publications voice: (831) 427-7796 The SCO Group fax: (831) 429-1887 email: bobs@sco.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]