Validating XML using JDOM and JAXP v1.1

I have a JDOM Document object which is constructed by my program. I need to validate the Document object against an XML schema on the fly (i.e. without saving the XML doc to the file system). I thought it might work to print the Document to standard output and have XMLReader parse that:

xmlReader.parse(new InputSource(new InputStreamReader(

System.in)));

but the parse method blocks waiting for input. For some reason it also doesn't work when I run the code in a different thread.

Any hints would be greatly appreciated. Should I use another class other than XMLReader?

Thanks,

C.R.

[695 byte] By [C.R.Crena] at [2007-11-27 8:52:23]
# 1
StringReader.
corlettka at 2007-7-12 21:07:48 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks! That helped a lot.
C.R.Crena at 2007-7-12 21:07:48 > top of Java-index,Java Essentials,Java Programming...