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

Possible whitespace problem with XT ?

Subject: Possible whitespace problem with XT ?
From: "Alistair MacDonald" <AlistairMacDonald@xxxxxxxxxxxxx>
Date: Tue, 27 Jul 1999 15:58:02 +0100
td whitespace
I can't decide it this is a problem with my interpretation of the spec, or something with XT.

I've got a problem cause by the way that both IE & Netscape interpret spaces in their input -- if they see spaces at certain points in their input they will make gaps larger. Whilst this particular example shows a problem with Netscape, I *could* have demonstrated a problem with IE - its just not quite to simple to show.

Take this stylesheet:
-----
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
  xmlns="http://www.w3.org/TR/REC-html40"
  result-ns=""
  indent-result="no"
>

<xsl:template match="/doc">
<table>
<xsl:for-each select="item">
<tr><td>*</td><td><xsl:value-of select="text()"/></td></tr>
<tr><td colspan="2" width="1" height="4"><spacer type="block" width="1" height="4"/></td></tr>
</xsl:for-each>
</table>
</xsl:template>

</xsl:stylesheet>
-----

and this input file:
-----
<doc>
<item>foo</item>
<item>bar</item>
</doc>
-----

The output is simple:
-----
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<table>
<tr>
<td>*</td>
<td>foo</td>
</tr>
<tr>
<td colspan="2" width="1" height="4">
<spacer type="block" width="1" height="4"></spacer>
</td>
</tr>
<tr>
<td>*</td>
<td>bar</td>
</tr>
<tr>
<td colspan="2" width="1" height="4">
<spacer type="block" width="1" height="4"></spacer>
</td>
</tr>
</table>
-----

Note that XT has chosen to add whitespace (carriage returns) -- despite my instruction not to (in the stylesheet)

If you compare the results of loading this file into Netscape (I've tried some v4 & v5 versions) with the version below you will see a difference in the layout. Unfortunately, this causes a problem! Ignoring the browser layout issue, is the fact that the file above doesn't look the one below a problem with my understanding, or with XT's whitespace handling ?

-----
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<table>
<tr><td>*</td><td>foo</td></tr>
<tr><td colspan="2" width="1" height="4"><spacer type="block" width="1" height="4"></td></tr>
<tr><td>*</td><td>bar</td></tr>
<tr><td colspan="2" width="1" height="4"><spacer type="block" width="1" height="4"></td></tr>
</table>
-----

Alistair


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


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.