[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Preserve Whitespace with Mixed Content (Text and Tags)

Subject: Preserve Whitespace with Mixed Content (Text and Tags)
From: James.Whitehead-1@xxxxxxxxxxxx
Date: Thu, 12 May 2005 17:55:43 -0400
preserving white space html
Hello,
Message-Id: <iss.609c.4283d0df.801be.1@xxxxxxxxxxxxxxxxxx>

I am generating html from an xml document, and would like to preserve white space inside tags that contain both text and other tags, such within these THD tags:
<THD>               <HL1>Load</HL1>            <HL1>Height</HL1></THD>

Ideally, I would like to end up with:
<pre>               Load                 Height</pre>
or, better:
<pre>               <b>Load</b>                 <b>Height</b></pre>

I have tried many xsl variations using using <xsl:preserve-space... and <pre> tags, but am unable to come up with a way to preserve the spaces (and line feeds) with this mixed content.  I always seem to end up with something like either:
<pre>Load Height</pre>
or:
<pre>LoadHeight</pre>

I have no trouble preserving white space if the inner tags are removed, such as here:
<THD>               Load                 Height</THD>
The <HL1> tags are not the only tags that might appear inside the <THD> tags -- a large number of other nested tags might show up as well. I do not have any control over the original source xml document. 

Can anyone please point me in the right direction?  I have searched Dave Pawson's FAQ, the XSL-List archives, and other some oft-cited web references, and if the answer is in one of these, I haven't seen it.  

Thank you for any information you can provide.

Regards,

Jim

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.