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

RE: Inserting White Space (  ) through XSL.

Subject: RE: Inserting White Space (  ) through XSL.
From: "Animesh Sharma" <asharma@xxxxxxxxxxxxxxxx>
Date: Mon, 3 May 2004 13:14:59 +0530
xsl nbsp
Stylesheet attached:

<?xml version= "1.0" encoding= "UTF-8" ?>
<xsl:stylesheet version= "1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" xmlns:fo= "http://www.w3.org/1999/XSL/Format">
<xsl:output encoding="UTF-8" method="xml"/>

<xsl:template match="//body/namespace/form/snip/csf/center/p[position()=1]">
<xsl:copy>
<xsl:apply-templates select="*|text()|@*"/></xsl:copy>
<table border="1" width="300" align="center" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
</tr>
<tr>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
</tr>
<tr>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
<td><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
</tr>
</tbody>
</table>
</xsl:template>

<xsl:template match="*|text()|@*">
<xsl:copy>
<xsl:apply-templates select="*|text()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet >
------------------------------------------------------------------------------------
Though it doesn't seems to be XSL problem any more. It's browser problem I think. Since, you have asked for it I'm writing the reason here. 

My Whole AIM was to get an Empty Table With Border around the Cells. in the Output HTML generated after applying XSL.

Quoted from some Site:
Empty cells in tables often cause problems to HTML authors, especially since browsers often display such cells without border even if the other cells have borders. There is an often-mentioned trick to solve that problem: put &nbsp; into an empty cell.

Going by above quotation I tried getting &nbsp; in the output. And I got that using using <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>.
But again another problem pop up because output generated is Not a well-formed XML as & get inserted in the output. And I cann't attach More XSL to the output generated. 

May be I have to find some alternative solution for the above problem.

Hope I haven't confused you more.

Regards,
Animesh


-----Original Message-----
From: Julian Reschke [mailto:julian.reschke@xxxxxx]
Sent: Monday, May 03, 2004 12:58 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Inserting White Space (&nbsp; ) through XSL.


Animesh Sharma wrote:
> Thanks Everyone.
> 
> As I have already, l had tried "&#160;". But it was not working. 

If it isn't working, *something else* is wrong. How are you 
transforming? Server side? Show us the source code.

> BEcause that iserts white space in the output text. and all browser are intelligent enough to remove the border incase there is no text found in TD element.

No, it doesn't.

> FYI, stuff that worked for me is:
> <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
> And this inserts &nbsp; in the output. 

It does, but only with some XSLT engines in some configurations. 
Meaning, it's not portable.

Best regards, Julian


-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

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.