wrote:
> I have an XML file that stores data from an HTML form. I use XSL to
> display the data in HTML format. The data may have newline characters.
> However, XSL is not displaying the newlines properly in the browser.
XSL is not displaying anything in the browser, the browser displays the
HTML your XSL produced and thus if you have any HTML display issue you
need to look into how HTML displays white space like newline characters.
And HTML's normal rendering of white space is white space collapsing
meaning whether you author e.g. a paragraph as
<p>a
b
c
d
</p>
or
<p>a b c d</p>
the normal rendering will collpase several white space characters in the
source to one inter-word space so rendering might be alike
a b c d
So the solution is to understand how HTML works and if the whitespace in
an element is to matter then to use for instance the <pre> element e.g.
<pre>a
b
c
d
</pre>
> I even replaced all the newlines with <BR/> tags but eventhough I see
> the tags in my source, I don't get a line break in the output document.
We need to see a minimal XSLT stylesheet and minimal XML input to make
suggestions on what you might be doing wrong in terms of XSLT to have
<br> elements in HTML output generated with XSLT.
Or look first at Philippe's answer to find a template that transforms
text with line breaks into markup with <br/> elements.
--
Martin Honnen
http://JavaScript.FAQTs.com/