You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Steffanina, Jeff" <Je...@marriott.com> on 2008/08/26 14:05:50 UTC
Issue with LineFeed
Friends,
Issue: When the first column in the table row contains 'TH', I want to
do a LINE FEED before the remainder of the table row is printed. The
other components in the "choose" are working perfectly. In general, I
am having problems forcing a line feed at various point in my style
sheet. I would appreciate any hints.
<xsl:choose>
<xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or
./vouc-type='CC'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block font-style="italic" line-height=".14in" >
<xsl:text> </xsl:text><xsl:value-of
select="vouc-charge-date"/>
</fo:block>
</xsl:when>
<xsl:when test="./vouc-type='TH'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block >
<xsl:text>
</xsl:text>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<xsl:value-of select="vouc-charge-date"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
Jeff
Re: Issue with LineFeed
Posted by Andreas Delmelle <an...@telenet.be>.
On Aug 26, 2008, at 14:45, Steffanina, Jeff wrote:
Hi Jeff
> Eric,
> The table was looking great until yesterday when the user made the
> request: If the vouc-type='TH' then insert a linefeed BEFORE the
> table row that includes the 'TH' is printed.
>
> I am trying to change as little logic as possible. Your diagram of
> the output is exactly right. In my sample of the code, I do not
> get the linefeed in ANY situation.
I think you need 'linefeed-treatment="preserve"'. Mind that this will
preserve *any* linefeed in the related block/text, so you have to be
very careful that no superfluous linefeeds end up in the output
(mostly this happens due to the built-in template rule for text,
which also gets applied to text nodes containing nothing but a linefeed)
HTH!
Cheers
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Issue with LineFeed
Posted by "Steffanina, Jeff" <Je...@marriott.com>.
Eric,
The table was looking great until yesterday when the user made the
request: If the vouc-type='TH' then insert a linefeed BEFORE the table
row that includes the 'TH' is printed.
I am trying to change as little logic as possible. Your diagram of the
output is exactly right. In my sample of the code, I do not get the
linefeed in ANY situation.
Jeff
________________________________
From: Amick, Eric [mailto:Eric.Amick@mail.house.gov]
Sent: Tuesday, August 26, 2008 8:32 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Issue with LineFeed 

I'm not sure I understand how exactly you want this to appear.
Are you looking for something like this?
DC column 2
TH
column 2
TR column 2
If so, I think it would make more sense to put a linefeed before
the data in every cell of the row but the first.
Eric Amick
Legislative Computer Systems
Office of the Clerk
________________________________
From: Steffanina, Jeff [mailto:Jeff.Steffanina@marriott.com]
Sent: Tuesday, August 26, 2008 8:06
To: fop-users@xmlgraphics.apache.org
Subject: Issue with LineFeed 

Friends,
Issue: When the first column in the table row contains 'TH', I
want to do a LINE FEED before the remainder of the table row is
printed. The other components in the "choose" are working perfectly.
In general, I am having problems forcing a line feed at various point in
my style sheet. I would appreciate any hints.
<xsl:choose>
<xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or
./vouc-type='CC'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block font-style="italic" line-height=".14in" >
<xsl:text> </xsl:text><xsl:value-of
select="vouc-charge-date"/>
</fo:block>
</xsl:when>
<xsl:when test="./vouc-type='TH'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block >
<xsl:text>
</xsl:text>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<xsl:value-of select="vouc-charge-date"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
Jeff
RE: Issue with LineFeed
Posted by "Steffanina, Jeff" <Je...@marriott.com>.
Andreas,
I made the change. However, I get the blank rows AFTER the 'TH' line.
I need the blank rows BEFORE the 'TH' line.
<xsl:choose>
<xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or
./vouc-type='CC'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block font-style="italic" line-height=".14in" >
<xsl:text> </xsl:text><xsl:value-of
select="vouc-charge-date"/>
</fo:block>
</xsl:when>
<xsl:when test="./vouc-type='TH'">
<xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
<xsl:text>

</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<xsl:value-of select="vouc-charge-date"/>
</xsl:otherwise>
</xsl:choose>
Jeff
-----Original Message-----
From: Andreas Delmelle [mailto:andreas.delmelle@telenet.be]
Sent: Tuesday, August 26, 2008 3:37 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Issue with LineFeed 

On Aug 26, 2008, at 21:18, Steffanina, Jeff wrote:
Hi Jeff
(see below)
> I may have confused the issue. If I take your sample output from
> earlier... I need the blank line ABOVE the TH. The TH is a
> header line that must be preceded by a blank row when it is found
> in column1 of the table.
>
> DC column 2
> TH
> column 2
> TR column 2
>
> See my "choose" logic below.
> <snip />
> <xsl:choose>
> <xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or ./vouc-
> type='CC'">
> <xsl:attribute name="white-space-treatment">preserve</
> xsl:attribute>
>
> <fo:block font-style="italic" line-height=".14in" >
>
> <xsl:text> </xsl:text><xsl:value-of select="vouc-charge-
> date"/>
> </fo:block>
> </xsl:when>
>
> <xsl:when test="./vouc-type='TH'">
> <xsl:attribute name="white-space-treatment">preserve</
> xsl:attribute>
>
add:
<xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
white-space-treatment only influences spaces, tabs and /treated/
linefeeds. Since the default/initial value for linefeed-treatment is
"treat-as-space", you need to explicitly override that.
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Issue with LineFeed
Posted by "Steffanina, Jeff" <Je...@marriott.com>.
Eric / Andreas,
I have resolved my spacing issue as you suggested!!
Thank you very much for the assistance.
Jeff
-----Original Message-----
From: Andreas Delmelle [mailto:andreas.delmelle@telenet.be]
Sent: Tuesday, August 26, 2008 3:37 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Issue with LineFeed 

On Aug 26, 2008, at 21:18, Steffanina, Jeff wrote:
Hi Jeff
(see below)
> I may have confused the issue. If I take your sample output from
> earlier... I need the blank line ABOVE the TH. The TH is a
> header line that must be preceded by a blank row when it is found
> in column1 of the table.
>
> DC column 2
> TH
> column 2
> TR column 2
>
> See my "choose" logic below.
> <snip />
> <xsl:choose>
> <xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or ./vouc-
> type='CC'">
> <xsl:attribute name="white-space-treatment">preserve</
> xsl:attribute>
>
> <fo:block font-style="italic" line-height=".14in" >
>
> <xsl:text> </xsl:text><xsl:value-of select="vouc-charge-
> date"/>
> </fo:block>
> </xsl:when>
>
> <xsl:when test="./vouc-type='TH'">
> <xsl:attribute name="white-space-treatment">preserve</
> xsl:attribute>
>
add:
<xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
white-space-treatment only influences spaces, tabs and /treated/
linefeeds. Since the default/initial value for linefeed-treatment is
"treat-as-space", you need to explicitly override that.
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: Issue with LineFeed
Posted by Andreas Delmelle <an...@telenet.be>.
On Aug 26, 2008, at 21:18, Steffanina, Jeff wrote:
Hi Jeff
(see below)
> I may have confused the issue. If I take your sample output from
> earlier... I need the blank line ABOVE the TH. The TH is a
> header line that must be preceded by a blank row when it is found
> in column1 of the table.
>
> DC column 2
> TH
> column 2
> TR column 2
>
> See my "choose" logic below.
> <snip />
> <xsl:choose>
> <xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or ./vouc-
> type='CC'">
> <xsl:attribute name="white-space-treatment">preserve</
> xsl:attribute>
>
> <fo:block font-style="italic" line-height=".14in" >
>
> <xsl:text> </xsl:text><xsl:value-of select="vouc-charge-
> date"/>
> </fo:block>
> </xsl:when>
>
> <xsl:when test="./vouc-type='TH'">
> <xsl:attribute name="white-space-treatment">preserve</
> xsl:attribute>
>
add:
<xsl:attribute name="linefeed-treatment">preserve</xsl:attribute>
white-space-treatment only influences spaces, tabs and /treated/
linefeeds. Since the default/initial value for linefeed-treatment is
"treat-as-space", you need to explicitly override that.
HTH!
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Issue with LineFeed
Posted by "Steffanina, Jeff" <Je...@marriott.com>.
Eric / Andreas,
I may have confused the issue. If I take your sample output from
earlier... I need the blank line ABOVE the TH. The TH is a header
line that must be preceded by a blank row when it is found in column1 of
the table.
DC column 2
TH
column 2
TR column 2
See my "choose" logic below.
Jeff
________________________________
From: Amick, Eric [mailto:Eric.Amick@mail.house.gov]
Sent: Tuesday, August 26, 2008 8:32 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: Issue with LineFeed 

I'm not sure I understand how exactly you want this to appear.
Are you looking for something like this?
DC column 2
TH
column 2
TR column 2
If so, I think it would make more sense to put a linefeed before
the data in every cell of the row but the first.
Eric Amick
Legislative Computer Systems
Office of the Clerk
________________________________
From: Steffanina, Jeff [mailto:Jeff.Steffanina@marriott.com]
Sent: Tuesday, August 26, 2008 8:06
To: fop-users@xmlgraphics.apache.org
Subject: Issue with LineFeed 

Friends,
Issue: When the first column in the table row contains 'TH', I
want to do a LINE FEED before the remainder of the table row is
printed. The other components in the "choose" are working perfectly.
In general, I am having problems forcing a line feed at various point in
my style sheet. I would appreciate any hints.
<xsl:choose>
<xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or
./vouc-type='CC'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block font-style="italic" line-height=".14in" >
<xsl:text> </xsl:text><xsl:value-of
select="vouc-charge-date"/>
</fo:block>
</xsl:when>
<xsl:when test="./vouc-type='TH'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block >
<xsl:text>
</xsl:text>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<xsl:value-of select="vouc-charge-date"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
Jeff
RE: Issue with LineFeed
Posted by "Amick, Eric" <Er...@mail.house.gov>.
I'm not sure I understand how exactly you want this to appear. Are you
looking for something like this?
DC column 2
TH
column 2
TR column 2
If so, I think it would make more sense to put a linefeed before the
data in every cell of the row but the first.
Eric Amick
Legislative Computer Systems
Office of the Clerk
________________________________
From: Steffanina, Jeff [mailto:Jeff.Steffanina@marriott.com]
Sent: Tuesday, August 26, 2008 8:06
To: fop-users@xmlgraphics.apache.org
Subject: Issue with LineFeed 

Friends,
Issue: When the first column in the table row contains 'TH', I want to
do a LINE FEED before the remainder of the table row is printed. The
other components in the "choose" are working perfectly. In general, I
am having problems forcing a line feed at various point in my style
sheet. I would appreciate any hints.
<xsl:choose>
<xsl:when test="./vouc-type='TR' or ./vouc-type='DR' or
./vouc-type='CC'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block font-style="italic" line-height=".14in" >
<xsl:text> </xsl:text><xsl:value-of
select="vouc-charge-date"/>
</fo:block>
</xsl:when>
<xsl:when test="./vouc-type='TH'">
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<fo:block >
<xsl:text>
</xsl:text>
</fo:block>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name="white-space-treatment">preserve</xsl:attribute>
<xsl:value-of select="vouc-charge-date"/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
Jeff