[jdom-interest] Newbie: Schema validation of a document being built via JDOM

Rick Nucci rick_nucci at boomi.com
Wed Mar 21 14:18:00 PST 2001


What if Document.validate() returns boolean, but also throws any validation
exceptions?

-Rick

-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Kevin Baynes
Sent: Wednesday, March 21, 2001 2:51 PM
To: Jason Hunter; Paul Jakubik
Cc: jdom-interest
Subject: RE: [jdom-interest] Newbie: Schema validation of a document
being built via JDOM


I got interested in this question and just wanted to toss some ideas out to
the group:

If there were a Document.validate(), should it return a JDOMException? or a
boolean?

Would the JDOMException contain enough information to be useful? Would you
return null if the document was valid? Would you just want the boolean
instead?

For a document to validate itself, couldn't it use this.getSerializedForm()
to get its own data, put it into a SAXBuilder and catch any
JDOMExceptions?(once getSerializedForm is implemented, that is)

Also, the document wouldn't know which parser built it. So in order to have
the document validate against the right parser the validate method might
have to look like:

public JDOMException validate(java.lang.String saxDriverClass) {}

-Kevin

-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Jason Hunter
Sent: Monday, March 19, 2001 12:01 PM
To: Paul Jakubik
Cc: jdom-interest
Subject: Re: [jdom-interest] Newbie: Schema validation of a document
being built via JDOM


Paul Jakubik wrote:
>
> While the validating as you go sounds good, I think
> there are some hard problems to be solved with it.

Yes.

> It would be nice to have a method (maybe on Document)
> to cause validation to occur on a JDOM document.

Yes.  Notice that's listed in TODO as a possible feature of JDOM 1.1.

> I would be interested to hear where some of the
> current maintainers stand on this.

Happy to have it, but we need volunteers to work on implementing it.

-jh-


_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list