Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage returns in field disappear?

Status
Not open for further replies.

kellstee

Technical User
Dec 31, 2005
37
US
I'm a total XML/XSL newbie and just can read a little bit. I have a shipping application where we can write templates in XSL, so I'm having to learn it.

I have a field in the application where we type comments like:

Customer needs the following items:
1 Red Shirt
2 Blue Socks
7 Green Bags

The comments field contains carriage returns. I have programmed the invoice to pull the comments field, but when the data spits out, it runs together like so:

Customer need the following items: 1 Red Shirt 2 Blue Socks 7 Green Bags

How can I get the invoice to respect the carriage returns that we have utilized in the comments field?
 
...and the fields in the application are implemented how? What language? Are they a textarea in an HTML form? Hard to guess...

Need some more to go on.

BTW, you were claiming you were a newbie in January. We will answer questions without that particular predicate. We just need a good problem description. :)

Tom Morrison
 
You could replace the line breaks (\r, \n, or a combination) with <br /> for purposes of inclusion in the XML, then swap them back when you're ready to display them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top