Predefined General Entity References

As we already know, there are five predefined entity references in XML, and they stand for characters that can be interpreted as markup or other control characters:

  • & becomes the & character

  • ' becomes the ' character

  • > becomes the > character

  • &lt; becomes the < character

  • &quot; becomes the " character

It turns out that you can create entity references for individual characters yourself in XML—all you have to do is to specify the correct character code in the encoding that you're using. For example, in the UTF-8 encoding, the character code for @ is #64 (where the # indicates that this value is in hexadecimal), so you can define an entity named, say, at_new, so that references to at_new will be replaced ...

Get Inside XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.