Altova Mailing List Archives


RE: [xsl] Is it possible to get " " in output rather than the encoded character?

From: "Steven Reddie" <smr@-------------->
To:
Date: 5/20/2004 2:15:00 AM
Hi Ken, thanks for this info.  Are you saying that by outputting a single
character rather than the text "&nbsp;" that the processor is non-conformant
(I think you're saying that section 16.2 makes this optional), or that
getting an 0xFF byte in the stream rather than an 0xA0 is the problem?

Thanks,

Steven

-----Original Message-----
From: G. Ken Holman [mailto:gkholman@xxxxxxxxxxxxxxxxxxxx] 
Sent: Wednesday, 19 May 2004 3:12 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Is it possible to get "&nbsp;" in output rather than the
encoded character?


At 2004-05-19 14:26 +1000, Steven Reddie wrote:
>I'm fairly new to XML and am trying to generate an HTML file from 
>XML/XSL. ... If I load the xml file (which references the xsl) from 
>within IE6 the "&#160;" is displayed as I'd expect (whitespace).  
>However, when using the Microsoft .NET XslTransform, outputting to 
>stdout and redirected to a file I get an ASCII character of value 0xff 
>in the file.

Sounds like the processor is not conformant.

>What I'd really like is
>to get the unencoded "&nbsp;" in the file so that it looks like typical 
>HTML.

Section 16.2 of XSLT says this is optional and one cannot request that it 
be that way or not:

   "The html output method may output a character using a character
    entity reference, if one is defined for it in the version of HTML
    that the output method is using."

>I've tried "&amp;nbsp" but it comes out unchanged.

Right ... as it should.

>If this is possible I'd really appreciate some pointers.

I would point to fixing the non-conformant behaviour and not trying to 
change something that is already working.

>On a similar note, is there some escape mechanism such as "\&nbsp" or 
>"&&nbsp" (I realise those aren't valid).

But you shouldn't be trying to escape it as it isn't text, it is 
markup.  No such method exists.

I hope this helps.

...................... Ken


--
Public courses: Spring 2004 world tour of hands-on XSL instruction
Next: 3-day XSLT/XPath; 2-day XSL-FO - Birmingham, UK June 14,2004

World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/m/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/m/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.