Look up special characters, symbols, and entities for XML and web pages
Parsed character entities are often useful to represent special symbols in HTML and XML. For example, you can use the named character entity ™ to represent the trademark symbol (™). The following line illustrates an entity declaration for the trademark character in a DTD for XML code:
<!ENTITY trade "&#x2122;"> <!-- TRADEMARK SIGN -->
In this example, the name of the entity is trade. The hexidecimal value of this entity is 2122. Complex schemas and DTDs often include hundreds of entity declarations for special characters and symbols that you’re liable to use in XML instances.
You may come across character entities in your code that you need to identify or troubleshoot. For example, special characters that don’t render properly by an application often come out as upside-down question marks (¿) or square boxes ().
To troubleshoot problems with special characters, a number of resources are available to you on the internet. The Unicode website (www.unicode.org) offers resources and information for thousands of different languages and symbols.
If you’re having problems with a character rendering properly, you can troubleshoot in a number of different ways—for example:
• You can open the XML file in a Unicode-aware text editor. Is the symbol declared and referenced as a named character entity (™) or the encoded character (™)?
• Open the XML file in a hexadecimal editor and locate the problem character. Record the hex value for the character that isn’t rendering properly and look it up online. Is the hex value correct?
We suggest you use named entities in your source XML because it allows you greater control of the encoding in your output.
For more resources, point your favorite web browser to www.zvon.org and click on Character Search. The Zvon Character search allows you to search for special symbols in a number of ways, including entity, hexadecimal, or decimal values.