RE: [xsl] soft returns/wrap not displaying the way I want

Subject: RE: [xsl] soft returns/wrap not displaying the way I want
From: "Clapham, Paul" <pclapham@xxxxxxxxxxxxx>
Date: Thu, 26 Apr 2001 08:35:50 -0700
This is a question about HTML, isn't it?  I don't know what hard and soft
returns are, but apparently you want to persuade the browser to break lines
of ordinary text in exactly the same place as if they were in a text area
input box.  But of course the browser won't do that on its own, and there's
no HTML option to tell it to do that (as far as I know, which isn't much),
so you were hoping that you could do it by preprocessing the text with XSL.

If I'm right so far, then what you need to do is to reverse-engineer the
browser's algorithm for line breaks, and to insert <p/> or <br/> in the
output text at the same place the browser would.  Or if you are using <pre>,
then perhaps insert newline characters instead.  However, if you are trying
to simulate a text area whose width can change if the user resizes the
browser window, then I suspect you are out of luck, since one of the inputs
to your algorithm needs to be "the maximum number of characters in a line".

There's only so much you can do to control what the browser does with your
HTML.  If you really want it to look exactly, precisely, your way, you may
be forced into producing PDF.


-----Original Message-----
From: Keddy, Paul [mailto:Paul.Keddy@xxxxxxxxxxxxx]
Sent: April 26, 2001 06:31
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] soft returns/wrap not displaying the way I want

I looked at the archives on this but still am having problems.

The text does everything I want it to do inside a textarea tag (ie. hard
returns display fine, soft returns as well, resizing browser window will
adjust the wrapping like i want), but to "display" (ie. outside of the
textarea) it, the soft returns do not work.  I want it to soft wrap exactly
like in the textarea box, problem is that the line just goes on forever and
no softwrap occurs.  (ie. this line doesn't do any softwraps...
<pre><xsl:value-of select="."/></pre>)

I am using IE 5.5.  I've tried attributes wrap="on"  cols="20"
language="XML" etc with the pre tag but no luck.

Any help is appreciated.

 XSL-List info and archive:

Current Thread