Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting an XML Node to XML String/Text

 
Krysty Sullivan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I convert a Node to its corresponding XML Text or String?
Node pageNode = pageNodeList.item(0);
//How can pageNode be converted to XML String
(e.g. <param><page>2</page></param> ?
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The interface Node has the method getNodeValue() which returns a String.
I guess this is what you are after.
Cheers,
Dan
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this. But you will need Xerces.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic