DOM Level 3 provides a method for validating a document in memory. This
FAQ [1] describes how to do it.
[1] http://xml.apache.org/xerces2-j/faq-dom.html#faq-9
"Travis Stevens" <[EMAIL PROTECTED]> wrote on 01/20/2005 01:56:34
PM:
> I am trying to validate a DOM with a schema. I am currently lo
Using ByteArrayInputStream wouldn't be a good idea. A String is not a
byte array, it's a char array. You certainly don't want to convert the
String to bytes and then reconvert it to chars, giving yourself an
opportunity to get the charset wrong.
What you want to do is create a StringReader.
Bob
By "converting the DOM into a String" I assume you mean the schema
DOM? If so, I believe that yes, you must serialize the DOM into a
String. Actually, to be more specific, you have to serialize the DOM
into a String and THEN create an InputStream out of that String (most
implementations I've seen