How to get the Document.toString object back to Docuement?

Hello,

I trasnform an document to a string by toString method, but I need the string back to the Doucument. here is the code, say I have Document object(already built), doc,

System.out.println(doc.toString() ), it print out: org.apache.crimson.tree.XmlDocument@76a746,

How can I get the xml Document back?

The reason I do so is that I need store over 6000 Document objects into a Vector, but it will out of memory if directly store the objects, but no problem store with the toString(). Using StringWriter to

transform doucment to a string with xml format is also get out of memory error.

any one can help, thanks!!

Fred

[678 byte] By [fredyzh] at [2007-9-26 3:38:53]
# 1

Hi,

When you say doc.toString(), it gives you a String representation of the doc. This String is entirely a different object. You can not transaform this String into a Document.

A Vector stores only references to objects. So, if you could store 6000 strings in a Vector, you can also store 6000 Documents. In both cases only references to the objects will be stored in the Vector.

thanks,

Srinivas.

sri_bitla at 2007-6-29 12:12:57 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thanks!
fredyzh at 2007-6-29 12:12:57 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...