XML new line formatting not showing in the page

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
mollydunn
Posts: 26
Joined: April 7th, 2022, 4:17 pm
Contact:

XML new line formatting not showing in the page

Unread post by mollydunn »

I am trying to get an address to show on the page, formatted like an address:

[Name] ([ERPAddressNumber])
[AddressLine1]
[AddressLine2]
[AddressLine3]
[AddressLine4]
[City],[State] [Zip]
[AddressId]

In the logs I see it formatted that way:
image.png
but when it shows on the page, I see it without line breaks.
image.png
here is how I'm creating those line breaks in the code:
image.png
I have also tried:

<br/>
&#13;
\n

Here is how I am referencing it on the View
image.png
How do I get the new line to come through on the view?
word count: 90

Tags:
mollydunn
Posts: 26
Joined: April 7th, 2022, 4:17 pm
Contact:

Re: XML new line formatting not showing in the page

Unread post by mollydunn »

I discussed this with another developer and received this answer

- XML: New lines, spaces, and tabs are removed if they are the only characters there. Try <xsl:text>&#xA0;&#x0D;&#x0A;</xsl:text>. &#xA0; is a non-breaking space and counts as a character that prevents it from being removed while &#x0D;&#x0A; is the same as "\r\n".

- CSS: Given that the new lines are in the logs though, then it's also possible that the CSS on the page is preventing it from showing. Try applying white-space: break-spaces; to the style of the control and see if that works.

I tried option two with adding the CSS styling and it solved the issue.
word count: 117
Post Reply