Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] in-memory validation

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] in-memory validation
  • Date: Tue, 7 Sep 2004 15:45:54 -0700

I think it would be useful to have a robust, convenient and efficient way for in-memory validation of an existing XOM Document, for example so that apps can check if their data is correct before sending it to other components. This should work with DTDs, W3C XML Schemas, etc. Currently it seems quite non-obvious how to do this best. One could do it various ways:

- Use doc.toXML() and run it through a Builder
- Run the doc through the XOM Serializer (or CanonicalSerializer?) to gain a byte array, and run that through a Builder
- Convert to DOM3 and run it through DOM validation
- Write your own SAX pieces and pipe events through a Builder (probably the best and also the hardest)
- in all cases that involve a Builder, write your own NullNodeFactory (for efficiency) - there is no need to build a new document if you're only trying to validate.

There seems to be quite a number of pitfals, inefficiencies and correctness problems around the issue, so perhaps a method such as

- public void Builder.validate(Document) throws ... or
- Document.validate(Builder)

would make all that a lot more straightforward.





Archive powered by MHonArc 2.6.24.

Top of Page