xsl-list
[Top] [All Lists]

[xsl] Trouble transforming special characters

2010-08-10 10:37:11
Hello,

I am transforming XML to HTML. The XML source has:

Peña

which should transform and display as Peña.

Instead, the 'ñ' gets transformed into a '?'.

Same problem with mdash

Processor Information:
XSL version: 1
Vendor: Microsoft
Vendor URL: http://www.microsoft.com

Using VS2008, C#, .NET 3.5

My XSLT begins with:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xml:space="default"
xmlns:l="urn::tlc.state.tx.us.salsa.legdoc">
  <xsl:output method="html" encoding="UTF-8" use-character-maps="cm1"
indent="yes"/>
  <xsl:character-map name="cm1">
    <xsl:output-character character="&#160;" string="&amp;nbsp;"/>
    <xsl:output-character character="&#8212;" string="&amp;mdash;"/>
    <xsl:output-character character="&#233;" string="&amp;eacute;"/>
    <xsl:output-character character="&#241;" string="&amp;ntilde;"/>
  </xsl:character-map>

  <xsl:param name="environment"></xsl:param>

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml";>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

---

Note that when I do the transformation in XMLSpy, it works fine. Using
it in code, though, produces a '?'.

I am a novice at XSLT so am sure that something is amiss. I have tried
to ferret this out with Google and your FAQ but I'm afraid it's over
my head or just too much info to digest and make sense of.

Any help, tips or tricks would be greatly appreciated. Thanks in advance,
-Craig

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>