Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Non-breaking space won't display properly in one instance

From: albruan@-------.---.(---------)
To: NULL
Date: 2/6/2008 10:20:00 AM

According to Visual Studio's Help on ASCII Character Codes, Chart 2, ASCII 
code 143 is Ã….  Anyway, following is a portion of the template:

<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" encoding="iso-8859-1"/>
	<xsl:template match="/">
	<info xml:space="preserve">
		<html>
			<body>
					<xsl:for-each select="Letter">
						<xsl:apply-templates select="Header"></xsl:apply-templates>
					</xsl:for-each>
			</body>
		</html>
	</info>
	</xsl:template>
	<xsl:template match="Letter/Header">
		<xsl:value-of select="Date" />
		<br />
		<br />
		<br />
		Provider ID:<xsl:value-of select="ProviderId" />
		<br />
		<xsl:value-of select="Name" />
		<br />
		<xsl:value-of select="Address1" />
		<br />
		<xsl:value-of select="City" />, <xsl:value-of select="State" 
/>&#160;<xsl:value-of select="Zip" />
		<br />
		<xsl:value-of select="Country" />
		<br />
		<br />
		<!--<xsl:apply-templates select="/Letter/Overpayments"/>-->
	</xsl:template>
</xsl:stylesheet>

In this case, I'm wanting a space between the State variable and the Zip 
variable, ala "City, State Zip".  It works fine on this machine, but displays 
as "City, StateÃ…Zip" on the other machine.

The XSL is created by parsing HTML form letter templates created within an 
HTML editor control, replacing placeholder tags with <xsl:value-of 
select="xyx"> and </xsl:value-of> tags and replacing all occurrences of 
&nbsp; with &#160; since the transformation process can't handle &nbsp;.  
Just prior to mailing out a batch of these form letters, the DB is queried 
for the pertinent information, which is returned in XML format.  The data is 
then transformed into a series of individual HTML files which are 
subsequently read in and converted into PDF format before being sent to a 
printer in the mail room for output.  All of this is accomplished within a 
.NET 2.0 solution.  The HTML output isn't intended to be viewed in a browser; 
we're merely looking at it to verify the format of the letters are correct.  

-- 
Things are more like they are now than they ever have been before.


"Martin Honnen" wrote:

> AlBruAn wrote:
> > I have an XSLT file I can use in my app along with XML-formatted data to spit 
> > out HTML 'til the cows come home without any problems.  However, when using 
> > it on another machine, all of my non-breaking spaces (I'm using   in the XSL) 
> > end up being displayed as Ã… (ASCII 143) in the HTML it generates.  To the 
> > best of my knowledge, both machines are set up fairly similarly as I'm 
> > working in a corporate environment in which all machines are staged alike.
> > 
> > What would cause this and what is the solution?  I've tried UTF-8, UTF-16 
> > and ISO-8859-1 encoding, but they've had no effect on the situation.
> 
> ASCII defines characters in the range 0 to 127 only.
> As for the problem, do you use client-side (e.g. browser-side) XSLT, or 
> how exactly do you use XSLT? Which browser does not render the results 
> as you want? Have you tried a different browser?
> 
> And show us the relevant excerpts (xsl:output and the lines creating the 
> non-breaking spaces) of your stylesheet.
> 
> -- 
> 
> 	Martin Honnen --- MVP XML
> 	http://JavaScript.FAQTs.com/
> 


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