Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the supported character entities for XML comments?

In the following example, & and Δ are OK but Δ is not (the latter two are both Δ). The compiler issues a warning similar to:

warning CS1570: XML comment on 'XXX.DocumentedMethod()' has badly formed XML -- 'Reference to undefined entity 'Delta'.'
    /// <summary>
    ///  &amp; &Delta; &#916;
    /// </summary>
    public void DocumentedMethod()
    {

    }

What are the supported character entities for XML comments?

like image 671
jrummell Avatar asked Oct 02 '09 20:10

jrummell


People also ask

What are character entities in XML?

Character entities are a method of including arbitrary characters in XML documents by referencing their UNICODE number rather than writing them directly. CSS has a similar mechanism to include special characters.

How many types of entities are there in XML?

In general, we have three types of entities: internal entities, external entities, and parameter entities.

What are character entities?

HTML character entities are basically a set of characters (entity) used to represent few characters reserved by the HTML, especially invisible characters or characters difficult to type out using a regular keyboard. HTML provides some entity names and entity numbers to use these symbols.


1 Answers

It's not a matter of comments, it's XML itself. XML only inherently knows about &amp;, &lt;, &gt;, &apos; and &quot; as well as the numeric entities. Anything else has to be declared explicitly.

See section 4.6 of the spec for further information.

like image 126
Jon Skeet Avatar answered Nov 01 '22 14:11

Jon Skeet