Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String from Document

 
Pavel Kubal
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, how can I get string representation of Document object? I mean XML document.
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this :
Element reqMsg = doc.getDocumentElement();
System.out.println( "Request Message = " + org.apache.soap.util.xml.DOM2Writer.nodeToString(reqMsg ) );
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic