[thelist] XML > XSL > HTML question

Kerin Cosford Kerin.Cosford at current-drugs.com
Thu May 24 09:27:10 CDT 2001


Hi everybody,

I'm working on a project which uses XSLT to transform the source XML from an
Oracle databse to HTML for display on the web.

I've got my XSL sheet all up and running nicely without any major hitches,
but theres on pretty important thing that I just can't seem to work out how
to do.

A couple of parts of my XML file hold large chunks of text. When I view the
XML file, I can see that the text (in CDATA[]) is nicely formatted with
carriage returns. Obviously though, XSL strips out all extraneous
whitespace, so I just end up with these *huge* blocks of text with no
linebreaks.

Now, I know how to get XSL to preserve whitespace, but thats no good - the
text comes through still formatted, but obviously newline characters mean
nothing to HTML - what I need to do is convert the newlines to <br>s, or
<p>s, or whatever.

So, how can I do this with XSL? Convert newlines to <br> tags for the output
tree? This is driving me nuts!

Thanks,

Kerin




More information about the thelist mailing list