[jdom-interest] xml schema support

philip.nelson at omniresources.com philip.nelson at omniresources.com
Sat Apr 7 06:27:56 PDT 2001


> I'm new to jdom, and want to find out if it will work
> for my application. I need to build xml documents that
> are valid against an xml schema. I don't see mention
> of xml schema support in the jdom docs. Can I write
> xml documents compliant with an xml schema in jdom?

Certainly!  JDOM can edit your schema perfectly :-) That may not be what you
expected to hear.  A schema is parsed, and the document is parsed and
compared against that schema (depending on parser settings) long before a
JDOM document is ever built.  So, JDOM can use the underlying parser and
report schema violations that way. The specific schema version you need and
features depend on which parser you use so as long as JDOM has an adaptor
for a parser that supports your schema type, JDOM is usable with your
schema.  

In memory validation against that schema within JDOM is not supported and
while the debate has not totally ended, I doubt it will be implemented.  The
main reason is that a complextype is not valid until the whole tree is
complete, but in JDOM you can build the parts completely independently.
Browse the list archives for more information on this.



More information about the jdom-interest mailing list