You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Doug Lochart <dl...@capecomputing.com> on 2004/08/13 22:18:44 UTC

Generating multiple newlines in output

Greetings,

I am trying to format a text report from an xml document.  There are sevral places I need to have 2 or 3 blank lines.  I have my xsl:output set to the following:  

<xsl:output method="text"/>

In my xsl stylesheet I have many of the following:

<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>

<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>

Each time I only get one blank line.  However I discovered if I place a space after the &#xa; like so:

<xsl:text>&#xa;  </xsl:text>

I will that blank line plus the next one.  I find this very confusing and frustrating.  Can someone please shed some light as to what is happening and what it is I need to do to accomplish my goals?

Thanks in advance,

Doug Lochart




Now I've gained some understanding 
Of the only world that we see.
Things that I once dreamed of
Have become reality.

These walls that still surround me
Still contain the same old me,
Just one more who's searching for
A world that ought to be.

Re: Generating multiple newlines in output

Posted by Doug Lochart <dl...@capecomputing.com>.
Ok I feel like an idiot.  I was looking at the driver program that I was
given to use and for some reason after the second pass transformation they
tokenize the output stream and add each token to a list and then save the
array items off in the result file.  The tokenizing was missing the extra
new lines.

Thanks for the offering of help anyway

Doug


Now I've gained some understanding
Of the only world that we see.
Things that I once dreamed of
Have become reality.

These walls that still surround me
Still contain the same old me,
Just one more who's searching for
A world that ought to be.
----- Original Message ----- 
From: "Henry Zongaro" <zo...@ca.ibm.com>
To: "Doug Lochart" <dl...@capecomputing.com>
Cc: <xa...@xml.apache.org>
Sent: Monday, August 16, 2004 3:13 PM
Subject: Re: Generating multiple newlines in output


> Hi, Doug.
>
> "Doug Lochart" <dl...@capecomputing.com> wrote on 08/13/2004 04:18:44
> PM:
> > I am trying to format a text report from an xml document.  There are
> > sevral places I need to have 2 or 3 blank lines.  I have my xsl:
> > output set to the following:
> >
> > <xsl:output method="text"/>
> >
> > In my xsl stylesheet I have many of the following:
> >
> > <xsl:text>&#xa;</xsl:text>
> > <xsl:text>&#xa;</xsl:text>
> >
> > <xsl:text>&#xa;</xsl:text>
> > <xsl:text>&#xa;</xsl:text>
> > <xsl:text>&#xa;</xsl:text>
> >
> > Each time I only get one blank line.
>
>      I don't seem to be able to reproduce the problem from your
> description.  I tried several versions of Xalan-J.  I always get a new
> line in my output for each instance of "<xsl:text>&#xa;</xsl:text>" that
> is executed in my stylesheet.
>
>      Could I ask you to provide a complete stylesheet, input document and
> expected result?
>
> Thanks,
>
> Henry
> ------------------------------------------------------------------
> Henry Zongaro      Xalan development
> IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
> mailto:zongaro@ca.ibm.com
>


Re: Generating multiple newlines in output

Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Doug.

"Doug Lochart" <dl...@capecomputing.com> wrote on 08/13/2004 04:18:44 
PM:
> I am trying to format a text report from an xml document.  There are
> sevral places I need to have 2 or 3 blank lines.  I have my xsl:
> output set to the following: 
> 
> <xsl:output method="text"/>
> 
> In my xsl stylesheet I have many of the following:
> 
> <xsl:text>&#xa;</xsl:text>
> <xsl:text>&#xa;</xsl:text>
> 
> <xsl:text>&#xa;</xsl:text>
> <xsl:text>&#xa;</xsl:text>
> <xsl:text>&#xa;</xsl:text>
> 
> Each time I only get one blank line.

     I don't seem to be able to reproduce the problem from your 
description.  I tried several versions of Xalan-J.  I always get a new 
line in my output for each instance of "<xsl:text>&#xa;</xsl:text>" that 
is executed in my stylesheet.

     Could I ask you to provide a complete stylesheet, input document and 
expected result?

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com