[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: [ANN] DoctypeChanger: pre-parse DOCTYPE manipulation
  • From: Jeff Turner <jeff@s...>
  • Date: Mon, 19 Nov 2001 20:29:59 +1100
  • Mail-followup-to: xml-dev@l...
  • User-agent: Mutt/1.3.23i

Hi,

I've extended a Java utility of Simon St.Laurent's[1,2], which allows
manipulating the DOCTYPE declaration of an XML stream before parsing.

This is useful when you want to validate an incoming XML document which
may have an incorrect or inaccessible DTD, or no DOCTYPE declaration at
all. The recent thread on "Interoperability" suggests that this is a
very common problem, only partially solved by custom EntityResolvers,
SOCATS, etc.

The code allows almost arbitrary flexibility; you can add a DOCTYPE
declaration, remove it, modify it (on a per-field basis), or
add/remove/modify conditionally, based on the old value.

It can be downloaded here:

http://opensource.socialchange.net.au/doctypechanger/

Documentation and examples here:

http://opensource.socialchange.net.au/doctypechanger/latest/apidocs/

It's under the Mozilla Public License 1.1, as was the original code.

All feedback appreciated :)

--Jeff

PS: I'm looking forward to the SAX people fixing this once and for all
with something like
http://sax.sourceforge.net/apidoc/org/xml/sax/ext/EntityResolver2.html


[1] http://www.simonstl.com/projects/doctypes/
[2] http://lists.xml.org/archives/xml-dev/200008/msg00145.html

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member