Hi, I am using Xerces Java Parser 1.4.4. I need to get the String value of the Document object. toString() returns null !!! Well I searched the API no method to get the String value of the XML Document object. Prior I was using Electric XML parser which had the method to get the String value of the document. Is it a DOM standard that Document should not provide method to get the String value? Is there any way I can get the String value of the Document object. Thanks for the time.
In the meantime, I've found another way to convert the XML doc into a string by serializing and then writing to a String, and here's that String:
How did you manage to serialize yoyr XML into a string?
I have tried: java.io.ByteArrayOutputStream byteArrayOutputStream = new java.io.ByteArrayOutputStream(); java.io.ObjectOutputStream objectOutputStream = new java.io.ObjectOutputStream(byteArrayOutputStream); objectOutputStream.writeObject(document); objectOutputStream.flush(); System.out.println(byteArrayOutputStream.toString("ISO-8859-1"));