From: Tatu S. <cow...@ya...> - 2006-11-22 00:22:20
|
--- Jimmy Zhang <cra...@co...> wrote: > I am wondering if there is a easy and quick way to > get rid of all > the external entity reference defined in DTD... > For version 2.0, it would be nice to offer a utility > that help people > convert the XML files with external entities to ones > without... Could be... but I have to say that properly dealing with DTDs, and especially entities, is lots of work. Probably more than 2/3 of work I have done with Woodstox has had to do with DTD-based features: dealing with nested input sources, parameter entity expansions and all related complexities (validity constraints of DTD itself) is much more complicated than basic xml parsing. DTD validation itself is not that hard, it's just building one's usual state machine (from dragon book or so), although even that is quite a bit of work. So I can understand why many parsers just choose to leave DTDs alone. ;-) There is no easy way to get rid of general entities; although perhaps it would be enough to just deal with common cases (ie. allow plugging in entity handlers for any unknown entity, and let using app define expansion, not xml parser). -+ Tatu +- ____________________________________________________________________________________ Sponsored Link $200,000 mortgage for $660/ mo 30/15 yr fixed, reduce debt http://yahoo.ratemarketplace.com |