Hi Shakya,

The XMLSerializer writes the document to an OutputStream or Writer. Before 
you call parse you need to set that on the XMLStreamWriter (e.g. 
XMLSerializer.setOutputByteStream(new ByteArrayOutputStream()). After 
parse, the document will have been written to the OutputStream. If you use 
a java.io.ByteArrayOutputStream, you would call toByteArray() to get the 
document after parse and then could wrap that into a 
java.io.ByteArrayInputStream which you could pass back to the 
XMLInputSource.

Thanks.

Michael Glavassevich
XML Technologies and WAS Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

Shakya Wijerama <[email protected]> wrote on 08/07/2012 01:50:09 
PM:

> Hello Michael,
> 
> In my custom SAXContenthandler I used the XMLSerializer rather than
> the SchemaDOMParser. Then I set the ContentHandler to the parser. In
> the custome content handler i forwarded all the calls to the 
> XMLSerializer. But after I parse the input source, how can I get the
> Document from the content handler? 
> 
> Thanks.

Reply via email to