Ecrion Software Inc. Homepage
Forum Home Forum Home > XF Designer > Knowledge Database
  New Posts New Posts RSS Feed: Preserve Line Breaks from XML
  FAQ FAQ  Forum Search   Register Register  Login Login

Preserve Line Breaks from XML

 Post Reply Post Reply
Author
Message / View First Unread Post
justinw View Drop Down
Admin Group
Admin Group
Avatar

Joined: 08 Dec 2011
Posts: 199
Post Options Post Options   Quote justinw Quote  Post ReplyReply Direct Link To This Post Topic: Preserve Line Breaks from XML
    Posted: 14 Dec 2011 at 9:40am
Q:  Within my XML, I have some text that contains multiple line breaks that I wish to maintain in my output.  Is it possible to have these line breaks reflected in my output, and if so, how do I implement this in the Designer?

A:  Yes this is achievable in the TEXT view of the XF Designer, and the correct method is to use the attribute (linefeed-treatment="preserve") on the parent fo:block of where your field is inserted.  For example, if I have the following XML:

<auto>
<car color="red">
This 
car
is 
red
</car>
</auto>

I would want to use the following code in my template:

<fo:block linefeed-treatment="preserve">
<xfd:field xpath="/auto/car"/>
</fo:block>

For more information on this usage, please visit:  

     


Edited by justinw - 14 Dec 2011 at 10:24am
Back to Top
lgmperera View Drop Down
Newbie
Newbie
Avatar

Joined: 03 Mar 2015
Posts: 2
Post Options Post Options   Quote lgmperera Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 2015 at 7:51pm
Hi,

I want to preserve line breaks in PDF view (OutputFormat.PDF). 
It's seems like it is not working correctly.

We have very long string value with several line breaks.  (e.g: Contents mean\r\nContents\r\n\r\nThe subsection)

It seems ā€œ\r\nā€ is working. 

But duplicate of ā€œ\r\nā€ (e.g: \r\n\r\n) is not working properly in PDF output.There should be 2 line breakers. But in PDF it shows only one line breaker. 

Any solution or workaround for that ???


My template is as follows. SpecialConditions is a long string with multiple line breaks.
            <fo:block linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve">
                  <xfd:field xpath="/MergeData/SpecialConditions" fo:font-family="Arial" fo:font-size="11pt"/>
                </fo:block>

Regards,
Gayan



Edited by lgmperera - 03 Mar 2015 at 9:58pm
Back to Top
gabrielan View Drop Down
Admin Group
Admin Group
Avatar

Joined: 04 Sep 2013
Posts: 64
Post Options Post Options   Quote gabrielan Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2015 at 4:26am
Hello Gayan,

Please send an e-mail with your issue to support@ecrion.com and one of my colleagues will assist you.

You will need to send them the documents used and information about the product you are using - product name, build number.

Have a good day!
Back to Top
lgmperera View Drop Down
Newbie
Newbie
Avatar

Joined: 03 Mar 2015
Posts: 2
Post Options Post Options   Quote lgmperera Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2015 at 4:27pm
I have managed to solve the issue. I have changed my xml by adding spaces and additional line breakers.
Thanks


Edited by lgmperera - 09 Mar 2015 at 5:35am
Back to Top
gabrielan View Drop Down
Admin Group
Admin Group
Avatar

Joined: 04 Sep 2013
Posts: 64
Post Options Post Options   Quote gabrielan Quote  Post ReplyReply Direct Link To This Post Posted: 06 Mar 2015 at 3:28am
Hello,

We are glad that everything works as expected now.

Should you have any other questions, please do not hesitate to either open a new topic or send an e-mail to our support team.

Have a good day!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.063 seconds.