Page 1 of 1

XML new line formatting not showing in the page

Posted: September 15th, 2022, 9:39 am
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?

Re: XML new line formatting not showing in the page

Posted: September 15th, 2022, 10:36 am
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.