This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to convert a node into xml format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to convert a node into xml format" Watch "How to convert a node into xml format" New topic
Author

How to convert a node into xml format

Raghunath Nandyala
Ranch Hand

Joined: Jan 24, 2006
Posts: 64
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


SCBCD,SCWCD,SCJP
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
You can use xslt for this.


Rahul Bhattacharjee
LinkedIn - Blog
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to convert a node into xml format
 
Similar Threads
Xml File Ecryption
Can an XML Node be converted to a String
XSL Table output.
XSLT - is it possible?
Converting an XML Node to XML String/Text