Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Inserting White Space ( ) through XSL.

From: "Michael Kay" <mhk@--------->
To:
Date: 5/3/2004 1:12:00 PM
Why are you using method="xml" to generate HTML? The entity reference & n b
s p ; isn't even defined in XML, so you are creating output formatted as XML
that isn't legal XML.

Are you running this transformation in the browser? 

Why are you declaring the xsl-fo namespace, is it just to confuse your
readers? 

Michael Kay

> -----Original Message-----
> From: Animesh Sharma [mailto:asharma@xxxxxxxxxxxxxxxx] 
> Sent: 03 May 2004 07:45
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Inserting White Space (&nbsp; ) through XSL.
> 
> 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: [xsl] 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent