dcsimg
How to generate xml from request object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Akash_Sharma
Posted On:   Tuesday, February 8, 2005 03:48 AM

I have an urgent req. Plz help me...




Thanks in advance

Re: How to generate xml from request object

Posted By:   WarnerJan_Veldhuis  
Posted On:   Tuesday, February 8, 2005 05:10 AM

Use DOM....


Use the org.w3c.dom.Document object to build a XML-document. (@see java.sun.com/......)


Untested, but for you to get the idea...:


DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Dcoument xmlDoc = builder.newDocument();

Element root = xmlDoc.createElement("my_root_node");
xmlDoc.appendChild( root) ;

Element child = xmlDoc.createElement("child_node");
root.appendChild( child );


etc...
About | Sitemap | Contact