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:
but when it shows on the page, I see it without line breaks.
here is how I'm creating those line breaks in the code:
I have also tried:
<br/>
\n
Here is how I am referencing it on the View
How do I get the new line to come through on the view?
XML new line formatting not showing in the page
-
- Posts: 26
- Joined: April 7th, 2022, 4:17 pm
- Contact:
-
- Posts: 26
- Joined: April 7th, 2022, 4:17 pm
- Contact:
Re: XML new line formatting not showing in the page
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> 
</xsl:text>.   is a non-breaking space and counts as a character that prevents it from being removed while 
 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.
- XML: New lines, spaces, and tabs are removed if they are the only characters there. Try <xsl:text> 
</xsl:text>.   is a non-breaking space and counts as a character that prevents it from being removed while 
 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