This project is read-only.

Numeric Encode xlst Transform

Topics: Developer Forum, User Forum
Sep 13, 2007 at 7:00 AM

I have a simple xsl transform below:

private static void testtransform()
MvpXslTransform xslt = new MvpXslTransform();
XsltArgumentList argList = new XsltArgumentList();
xslt.Transform(new XmlInput("in.xml"), argList, new XmlOutput("out.xml"));
catch (Exception ex)

in.xml is UTF-8 encoded.

test.xsl specifies US-ASCII encoding (<xsl:output method="xml" version="1.0" encoding="US-ASCII" indent="yes"/>).

As a result, when I do a transform, it generates the below error:

Unable to translate Unicode character \u201C at index 293 to specified code page. at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)

Instead, I would like it to numeric encode what falls outside the ASCII code page. Looking at the documentation, it appears that I could do something with WriteCharEntity, but am uncertain how to do so.

Any help would be appreciated.


Sep 29, 2007 at 7:36 PM
MvpXslTransform doesn't support this feature. Here is a sample implementation you can follow: