jdom icon indicating copy to clipboard operation
jdom copied to clipboard

RFE: In-memory validation

Open hunterhacker opened this issue 14 years ago • 3 comments

Ideally support Schema, DTD, and Relax NG.

hunterhacker avatar Aug 01 '11 03:08 hunterhacker

I see two basic mechanisms for doing this. The first is to extend the process for adding JDOM content to include validation, similar to how the Verifier concept works: validate as the document is built. Alternatively, a mechanism for taking a 'static' document and doing a single in-place validaton with some type of back-reference to any failing content.

Neither mechanism would be particularly easy, the first is more in line with how JDOM is supposed to behave.... get a JDOMException if you add invalid content. The second mechanism is less useful (since you can always output/parse/validate).

How do people see this being applied?

rolfl avatar Dec 08 '11 14:12 rolfl

If we tried to verify as it's being built, wouldn't that be seriously slow?

I think the purpose behind this originally was to make it easier on people, and ideally faster by doing it against the JDOM object model rather than output/parse/validate.

hunterhacker avatar Dec 09 '11 05:12 hunterhacker

I still cannot think of a good ay to implement this. 'Validation' for XML is so broad, and complex, that trying to natively support some form of correcte validation against DTD, XSD, SchemaNG, whatever is just too hard.... without JDOM becomming something like the xerces 'monstrosity'.

Assuming it can be done as some form of extension to the current API, then I cannot see why this should be an issue for the JDOM2 release.... so it is 'deferred'

rolfl avatar Feb 01 '12 01:02 rolfl