• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Converting a Document type into String

Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've a java object of type org.w3c.dom.Document. How to covert this document into a String?.
Thanks for your time.
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at the foll. Seems like exactly what you want to do....
- madhav
It runs on an internal combustion engine. This ad does not:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic