[jdom-interest] Document validating in memory (JDOM beginner)
Christian Holmqvist, IT, Posten
christian.holmqvist at posten.se
Fri Mar 22 00:47:44 PST 2002
I had a thread here about realtime validation when building XML (from the
code i.e. not with a stream!!) documents with JDom for about 1,5 years ago.
The idea was kind of simple,
* a wrapper for the Document that instantiated with a DTD/Schema. (To keep
realtime validation seperated from "Normal" Document handling.
* X (elements, attributes what ever) is created in normal fashion (without
attachment to a document).
* as the X is added to the wrapper controlles if it is a valid object to add
at the point of the document the curser is positioned.
* if incorrect, exception is thrown or some other form of indication.
So what is the hard part of this? Well first a step by step validator kind
of a debugger running step by step operations...
The drawback is ofcourse that the performance of the document handling with
the wrapper would be impacted, but when the document is done it IS done!!
If I don't recall incorrectly I think it was you Jason that discarded this
idea as not inside the JDom scope... *smile*
/Christian "Acroo" Holmqvist
Software Engineer, Posten IT Sweden.
> Not currently. It's a feature we'd like to see added. The
> best way to
> validate after manipulation is to output and re-parse the file letting
> the parser validate. It's not great, but it's no worse than DOM.
> Robert Gulyas wrote:
> > Hi All,
> > I need to validate my Document againts a DTD before it's
> sent back to
> > the client in a Tomcat webserver. Can it be done in the memory in a
> > simple, not memory exhausting way? Please help me with any
> > Thank you in advance,
> > Robert
> > PS: I used the mail archives but I didn't find any solution...
> > _______________________________________________
> > To control your jdom-interest membership:
To control your jdom-interest membership:
More information about the jdom-interest