RE: Whitespace again

Subject: RE: Whitespace again
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 29 Jun 1999 17:48:30 +0100
> 
> Thank you for you answer,
> but it still doesn´t work.
> 
> > >
> > > I have a xml documnet:
> > >
> > > <text>line 1
> > > line 2
> > > </text>
> > >
> > > My problem is that in the html output there is no 
> linebreak. 

The XSL facilities for whitespace control (xsl:preserve-space, etc) are
irrelevant to this: they only affect whitespace that is surrounded on both
sides by tags.

Whitespace that has text before or after it (or in this case, both before
and after) should be copied to the output file.

But if the output is HTML, this is irrelevant, because newline characters in
HTML are equivalent to spaces.

If you want a visible line break in the page as displayed by the HTML
browser, your options are:

a) generate a <PRE> </PRE> element around the output text
b) convert the newlines in the text to <BR> tags (a nice little exercise in
the use of substring-before, concat, etc)

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread