• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOM Node to XML

 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one please let me know if there is a utility/method to convert a DOM node to an XML. I have manipulated the Node object and I want to see it's contents. Can I print it in the form of an XML?
Thank you
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks to me like you can create a javax.xml.transform.dom.DOMsource from a Node and then use a Transformer to process that Source to a Result which could write to a string or output stream.

See javax.xml.transform.stream.StreamResult
javax xml.transform.Transformer
etc.

Bill
 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic