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>
/// & Δ Δ
/// </summary>
public void DocumentedMethod()
{
}
What are the supported character entities for XML comments?
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.
In general, we have three types of entities: internal entities, external entities, and parameter 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.
It's not a matter of comments, it's XML itself. XML only inherently knows about &
, <
, >
, '
and "
as well as the numeric entities. Anything else has to be declared explicitly.
See section 4.6 of the spec for further information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With