• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to convert a node into xml format

 
Raghunath Nandyala
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Im having one node (Element) say root, How to convert this into a string that represents XML format data like <root></root>.

Thanks
Raghunath N
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use xslt for this.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably you have the name of the Node, why not just build a String with that name? No need to fire up XSLT.
Note that if there is text content contained by that Element you will have to extract the Text node that holds the content.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic