Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple lines text in XML tag

 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
" 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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic