Note that there are some explanatory texts on larger screens.

plurals
  1. POWriting out umlaut chars in XML?
    primarykey
    data
    text
    <p>I need to write the "&amp;#D;" equivalent of a umlaut char to an xml. Example if the string is "für" then the expected output is "<code>f&amp;#252;r</code>" the <code>&amp;#252;</code> being the equivalent of ü</p> <p>Here is the code I currently have:</p> <pre><code>private bool WriteOutXMLFile(string xsltFileName, XsltArgumentList argsList, string outputFile) { XslCompiledTransform transform = new XslCompiledTransform(true); transform.Load(xsltFileName); using(StreamWriter sw = new StreamWriter(outputFile,false,Encoding.UTF8)) { transform.Transform(this.InputFilePath, argsList, sw); } return true; } </code></pre> <p>Here is the XSLT:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:dt="urn:schemas-microsoft-com:datatypes"&gt; &lt;xsl:output method="xml" /&gt; &lt;xsl:param name="InsideSales1"&gt;&lt;/xsl:param&gt; &lt;xsl:param name="InsideSales2"&gt;&lt;/xsl:param&gt; &lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;!--Project output nodes--&gt; &lt;!--Calculation Number--&gt; &lt;xsl:template match="kalkulationsnummer" &gt; &lt;xsl:element name="kalkulationsnummer"&gt; &lt;xsl:value-of select="$CalculationNumber" /&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>I have remove a lot of params for space considerations.</p> <p>Can someone help?</p> <p>Regards.</p> <p>Hello everyone, I have used System.Web.HttpUtility.HtmlEncode method to get the required value for umlaut chars when adding them to the argsList. This was a quicker way of doing things but it may not work as it is not tested for my requirement. a better approach would be to use a byte array, suggested in this post. Thanks to everyone who replied.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload