[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [XSL-FO] Linebreaks on a page break (linefeed-tre

Subject: Re: [XSL-FO] Linebreaks on a page break (linefeed-treatment)
From: "Mathias Leclercq mathias.leclercq@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Jul 2018 05:43:32 -0000
 Re: [XSL-FO] Linebreaks on a page break  (linefeed-tre
Hello guys,

So I did a recursive named template with the code below and the line-breaks
are effectively transformed.
I still had the problem though but because my empty blocks were in a
<fo:inline> node.
I removed the inline node and now it's working!
Thanks a lot for your help!

For further reference:

[XSLT 1.0] [XSL-FO] [FOP 1.0] Fix for line-feed issue on page-break with
different page layouts (margin left and right)

-   No <fo:block> inside <fo:inline>

-   Replace line-feed &#x000A; with &#x00A0;<fo:block/> with a recursive named
template

-   Remove linefeed-treatment="preserve" and
keep-together.within-page="always" attributes

<xsl:template name="gReplaceLineBreak">
        <xsl:param name="pString"/>
        <xsl:choose>
               <xsl:when test="substring-before($pString,'&#xA;')">
                       <xsl:value-of
select="substring-before($pString,'&#xA;')"/>&#x00A0;<fo:block/>
                       <xsl:call-template name="gReplaceLineBreak">
                               <xsl:with-param name="pString"
select="substring-after($pString,'&#xA;')"/>
                       </xsl:call-template>
               </xsl:when>
               <xsl:otherwise>
                       <xsl:value-of select="$pString"/>
               </xsl:otherwise>
        </xsl:choose>
</xsl:template>



From: Flynn, Peter <pflynn@xxxxxx>
Sent: Monday, July 2, 2018 10:01 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [XSL-FO] Linebreaks on a page break (linefeed-treatment)

On 2018-07-02 08:31:06+01:00 Mathias Leclercq
mathias.leclercq@xxxxxxxxx<mailto:mathias.leclercq@xxxxxxxxx> wrote:

Someone suggested me to replace linefeed characters in my text area with an
empty block &lt;fo:block&gt;&lt;/fo:block&gt;.

Problem is, I don't know what character to look for (xml is encoded in utf-8
on a windows machine).
The numeric character entity &#xa; matches a newline, so
replace(textArea,'&#xa;[&#xa;]*','&#xa;') will replace all multiple newlines
with a single newline.

If you are constrained to using XPath 1.0, you could write a recursive named
template to do the job, testing for two newlines each time, and replacing with
one, until no double newlines are left, then emitting an <fo:block/>

///Peter

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.