Groping toward a solution
-
Ents
Back in February 2002, I published Ents, a dead-simple utility for converting entities to character references and vice-versa. It's trivial code, but it made it very easy for me to convert DocBook chapters into plain-enough XML for me to process directly with ordinary tools.
-
Parser integration
Unfortunately, by the time most parsers let me touch their results, the entity processing has already worked, or not worked. There are a few tools and techniques for dealing with this.
-
Elements as entities
Sean McGrath and a number of others recommend using empty elements rather than entity references, and using processing later to turn them into characters or whatever they should be. In many ways it's a less verbose XInclude, requiring more application configuration, but it's plainly a useful option in some cases.
-
Entity resolvers
Many parsers provide hooks for entity resolvers. Few people write them; fewer people publish them. They're a useful extension, but typically hard-wired, focused on a particular set of entities, and return an InputSource, not a simple result.
-
skippedEntity events, etc.
Applications can of course pick up the pieces if they want. (This doesn't always work for attributes!)
-
XML Catalogs
OASIS XML Catalogs are focused on URI resolution, getting results from (perhaps unavailable) SYSTEM identifiers and (otherwise opaque) PUBLIC identifiers. They're a useful patch for sharing processing assumptions across systems, though at the level of resource retrieval.
Previous Page <
TOC
> Next Page