GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Ideally support Schema, DTD, and Relax NG.
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?
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.
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'