[jdom-interest] Document validating in memory (JDOM beginner)

Ken Rune Helland kenh at csc.no
Thu Mar 21 11:47:10 PST 2002

> 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.
> -jh-
> 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 suggestion!


I'm only guessing here but woudnt it make sense if you implement a
sax-parser to have one layer that reads the xml and if validation
is turned on feed the sax events to a second layer doing the validation.

If so and the sax-parsers often being open source it shoud be possible to
use the second layer and feed it events from the saxoutputter.

My exsperiense with XSLT is that feeding transformers sax-events via 
JDOMSource is about 30% faster than feeding it a xml stream via 
outputter and streamsource. I woud expect a sax-consuming validation
to have at least the same speedup for validation.

I'm sorry I'dont have time too look onto this in any near future, but
I thought I woud throw the idea into the forum for any sax-gurus with
som free time on their hands to ponder on.


More information about the jdom-interest mailing list