|
Ok! Got a Solution!
Used StringWriter to hold the
XML DOM tree and used it as input to SAX InputSource.
DOMSource objXMLSource = new DOMSource(sourceDocument);
StringWriter stringOut = new StringWriter();
StreamResult objResultStream = new StreamResult(stringOut); Transformer objTransformer = TransformerFactory.newInstance().newTransformer(); objTransformer.transform(objXMLSource, objResultStream); String xmlString =
stringOut.toString();
ByteArrayInputStream stream
= new ByteArrayInputStream(xmlString.getBytes());
InputSource is = new
InputSource(stream);
Regards
Prasanna Kumar
|
- RE: DOM to SAX InputSource Prasanna Kumar AG
- RE: DOM to SAX InputSource Aleksandar Milanovic
