[jdom-interest] validation of xml created by jdom.

Jason Hunter jhunter at acm.org
Thu Oct 11 15:05:24 PDT 2001


This should probably be added to the FAQ, it's asked often enough.

In-memory validation is a TODO item and a feature we very much want to
have implemented.  No other XML libraries have it that I know of, and
it'd be great for JDOM to be the first.  As you can see in TODO.txt,
we'd like to have validation against a DTD, against a schema, and
against an arbitrary set of business rules.  We're looking for
volunteers to take on this effort.

The workaround in the meanwhile is to use the parser's validation
feature which requires serializing the document and reparsing it with
validation turned on.  It's not fast, but it gets the job done.  If you
want it fast, you should be the volunteer.

-jh-

> Saradha wrote:
> 
> Hi,
> 
> I use JDOM and create Elements, setText for them, getting values from
> a UI, set the SYSTEMID in the xml giving the DTD name and create a
> Document using the rootElement and use the XMLOutputter to dump the
> xml created to System.out.
> 
> Now I want that xml created by the Jdom to be validated against the
> DTD I have specified in the SYSTEMID before I dup it to the
> System.out.
> How do I do that?. I don't see way to validate this newly generated
> xml
> generated using jdom.
> 
> Thanks,
> saradha.



More information about the jdom-interest mailing list