Common Entities Converted to ML-Macros

This version:

Revision 0.1 (2006-02-04)

John L. Clark


This article highlights a set of common XML character entities that I have converted to use the ml-macro syntax.

Yesterday I converted ml-macros to an XSLT 1/EXSLT solution. I then promptly realized that it would be nice to have some public macros to use with these scripts, so I went and converted the W3C XML Entity Declarations for Characters used by DocBook, MathML, and XHTML 1/HTML 4.01 to the ml-macro syntax. You can currently find them here, and perhaps someday you'll be able to find them in a more "standard" location. The entity files use a .ent suffix; the corresponding ml-macro files use a .mlm suffix. For a complete list of the macro files available, see “Macro Files by Category”.

The macro names are all the same as the entity names, so for example if you wanted the infinity character, you could do something like the following:

Running it through either the XSLT 2 or the XSLT 1/EXSLT version of the script should then retrieve the macro definitions and expand the [[infin]] macro to the proper character reference (∞), conveniently all without the use of a Doctype declaration (which was the whole point in the first place). And of course, you can use XML Catalogs to resolve the URLs to these macro files (while still using the URLs as identifiers), so you don't have to retrieve them over the net each time you use them (please and thank you).

This page was last modified on 2006-02-04 00:00:00Z.

This page was first published on .

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

See the version of this page with comments enabled to read or add comments.