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

RE: [xsl] Control line breaks by xslt


Subject: RE: [xsl] Control line breaks by xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 1 Nov 2007 08:31:12 -0000

Saying indent="yes" in xsl:output allows the processor to indent the output
any way it chooses. If you don't want that, don't specify indent="yes"; you
will then get no extra whitespace in the output unless you create it
explicitly using <xsl:value-of> or <xsl:text>.

If you want more intelligent formatting, you can use Saxon in schema-aware
mode, validating the output against a schema. It will then avoid applying
indentation to elements that are defined in the schema to have a mixed
content model, which seems to be the effect you are looking for here.

Michael Kay
http://www.saxonica.com/



> -----Original Message-----
> From: J. S. Rawat [mailto:jrawat@xxxxxxxxxxxxxx] 
> Sent: 01 November 2007 04:50
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Control line breaks by xslt
> 
> Hi Group!!!
> Can we control line breaks by xslt. My conversion processor 
> is Saxon.exe.
> 
> INPUT
> <note>
> <title>Nets Notes</title>
> <para><link linkend="nets_S2">NETS <emphasis 
> role="italic"><emphasis role="bold">S</emphasis></emphasis> 
> 2</link></para> </note>
> 
> OUTPUT
>           <box>
>              <title>Nets Notes</title>
>              <para>
>                 <xref pointer="nets_S2">NETS <i>
>                       <b>S</b>
>                    </i> 2</xref>
>              </para>
>            </box>
> 
> Desired OUTPUT
>           <box>
>              <title>Nets Notes</title>
>              <para><xref pointer="nets_S2">NETS <b>S</b> 
> 2</xref></para>
>           </box>
> 
> XSL
> <xsl:output method="xml" indent="yes"/>
> 
> thanks
> ...JSR


Current Thread
Keywords