| Author |
multiple lines text in XML tag
|
Steve Jiang
Ranch Hand
Joined: May 17, 2004
Posts: 106
|
|
If I put long text in multiple lines in XML tag, the display will put all stuff together. Is there any setting to keep origianl format with return to keep text as multiple lines? For exmaple <TEST> 1234567 1234567 1234567 </TEST> the browser display <TEST> 1234567 1234567 1234567 </TEST> [ March 29, 2007: Message edited by: Steve Jiang ]
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Browsers change newline characters to spaces. That's just what they do. If you don't want that to happen, either put the text into a <pre> element in your HTML or replace the newline characters by <br/> elements.
|
 |
Steve Jiang
Ranch Hand
Joined: May 17, 2004
Posts: 106
|
|
" Browsers change newline characters to spaces. That's just what they do. If you don't want that to happen, either put the text into a <pre> element in your HTML or replace the newline characters by <br/> elements. " I use browser to open XML file. </br> works for HTML , but looks it doesn't work for XML. Is there way to display return of multiple lines for XML with browser? Thanks,
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Is there way to display return of multiple lines for XML with browser?
No, at least not without rerendering the XML in the way Paul suggests. There is nothing in the XML specification to say white space should be maintained. The examples you give are considered identical from XML's point of view, so you are at the mercy of whatever technology you use to display it as to how it is rendered.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
 |
|
|
subject: multiple lines text in XML tag
|
|
|