Altova Mailing List Archives

Re: [xsl] Trouble transforming special characters

From: Martin Honnen <Martin.Honnen@---.-->
To: xsl-list@-----.------------.---
Date: 8/10/2010 3:43:00 PM
Craig Whisenhunt wrote:
> Hello,
> I am transforming XML to HTML. The XML source has:
> Pe&ntilde;a
> which should transform and display as Peña.
> Instead, the '&ntilde;' gets transformed into a '?'.
> Same problem with mdash
> Processor Information:
> XSL version: 1
> Vendor: Microsoft
> Vendor URL:
> Using VS2008, C#, .NET 3.5
> My XSLT begins with:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="" xml:space="default"
> xmlns:l="">
>   <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>

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

I think I did explain elsewhere that XMLSpy">XMLSpy supports XSLT 2.0 (i.e 
xsl:character-map) while XslCompiledTransform is an XSLT 1.0 processor 
that does not support any XSLT 2.0 constructs.
If you want to use XSLT 2.0 with .NET code then use Saxon 9 
( or use AltovaXML tools 


	Martin Honnen

XSL-List info and archive:
To unsubscribe, go to:
or e-mail: <mailto:xsl-list-unsubscribe@l...>


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 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.