|
|
|
date: Wed, 6 Feb 2008 08:11:00 -0800,
group: microsoft.public.xsl
back
Re: Non-breaking space won't display properly in one instance
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"
/> <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
with since the transformation process can't handle .
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/
>
date: Wed, 6 Feb 2008 10:20:03 -0800
author: AlBruAn .(donotspam)
Re: Non-breaking space won't display properly in one instance
Well, the guy who was having problems with it came up with a solution. It's
not exactly efficient, but at least it works. Every place where a space is
needed between data fields, he has inserted the following statement:
<xsl:text disable-output-escaping="yes"> </xsl:text>
If that's all it takes, I'll modify my code that creates the XSL to use this
statement everywhere a space is required.
--
Things are more like they are now than they ever have been before.
"Martin Honnen" wrote:
> AlBruAn wrote:
>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > <xsl:output method="html" encoding="iso-8859-1"/>
>
> So your stylesheet has that output element. Does the resulting HTML
> document have a meta element
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> then?
>
> > 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.
>
> Which browser do you use to look at the transformation results? Have you
> checked the settings of the browser? It could be set to ignore the
> charset in the document.
>
>
> > 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
> > with since the transformation process can't handle .
> > 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.
>
> Can you show us the .NET 2.0 code that does the transformation and
> creates the HTML output?
>
>
> --
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
>
date: Wed, 6 Feb 2008 12:16:02 -0800
author: AlBruAn .(donotspam)
|
|