Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If your document contains insignificant whitespace which you want to distinguish from your <code>&amp;#xA;</code> entities, you can use the following (much simpler) solution: Convert the <code>&amp;#xA;</code> character references temporarily to another character (that is not already present in your document), perform your XML processing, and then convert the character back in the output result. In the example below, we shall use the private character <code>U+E800</code>.</p> <pre><code>static string ProcessXml(string input) { input = input.Replace("&amp;#xA;", "&amp;#xE800;"); XDocument document = XDocument.Parse(input); // TODO: Perform XML processing here. string output = document.ToString(); return output.Replace("\uE800", "&amp;#xA;"); } </code></pre> <p>Note that, since <code>XDocument</code> resolves numeric character references to their corresponding Unicode characters, the <code>"&amp;#xE800;"</code> entities would have been resolved to <code>'\uE800'</code> in the output.</p> <p>Typically, you can safely use any codepoint from the Unicode’s “Private Use Area” (<code>U+E000</code>–<code>U+F8FF</code>). If you want to be extra safe, perform a check that the character is not already present in the document; if so, pick another character from the said range. Since you’ll only be using the character temporarily and internally, it does not matter which one you use. In the very unlikely scenario that all private use characters are already present in the document, throw an exception; however, I doubt that that will ever happen in practice.</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.
    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