aspose file tools*
The moose likes Product and Other Certifications and the fly likes Converting a Document type into String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Converting a Document type into String" Watch "Converting a Document type into String" New topic
Author

Converting a Document type into String

Maalti Iyer
Ranch Hand

Joined: Jul 11, 2001
Posts: 52
Hello,
I've a java object of type org.w3c.dom.Document. How to covert this document into a String?.
Thanks for your time.
Maalti
Hari Vignesh Padmanaban
Ranch Hand

Joined: Oct 07, 2003
Posts: 578
Why would u want to do that ?
If You need teh conents of the document, I think teh only way to do it is is parse teh document and write it in a String buffer and then call toString() on that String buffer !!!
I am not sure about any utility method that would convert the Document objects contents into a String directly !!!
And if converting to a string was not for this purpose, please do state specifically the requirement for converting the document obj to a string
hope this helps
hari
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Take a look at the foll. Seems like exactly what you want to do....
http://test.javaranch.com/wiki/view?DocumentToString
regds.
- madhav


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting a Document type into String
 
Similar Threads
DOM Document to xml
empty lines in a document.
Problem in creating a jdom document
Document to String
Data Type to Hold Rich Text in Java