PDA

View Full Version : Displaying XML in a webpage with line breaks



Aro2220
23 Mar 2009, 12:41 PM
Hi,

I'm very new to XML and pretty much everything.

I took this document that had 81 different parts to it and created an XML file that has the general structure of
<theway>
<way>
<heading>stuff</heading>
<body>stuff</body>
</way>
<way>
<heading>stuff2</heading>
<body>morestuff</body>
</way>
</theway>

The problem is the body is in paragraphs with line breaks here and there to retain its formatting.

I want to display this onto a webpage as simply as possible (like in HTML so every browser can view it). I've read that I can do this with CSS, XSL, or Actionscript.

I got the CSS example working fairly easily but I don't know how to display line breaks. I even tried <BR> tags but that messed up my XML so I tried &lt;BR> which fixed the error but when displaying in CSS the &lt;BR> tag is gone and it doesn't do anything.

I just want to retain the paragraph formatting in the <body> field when I display this on a webpage.

What's the best way to do this? I don't neccesarily need to use CSS...whatever is easiest and most compatible.

Thanks!