aspose file tools*
The moose likes Servlets and the fly likes How to create an XML document from a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to create an XML document from a form" Watch "How to create an XML document from a form" New topic
Author

How to create an XML document from a form

Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Hi, I have a servlet that handles a form action from a JSP file. What I want to do is to create (update - append) an XML document using the form values. Does anyone know how to do it? is there any open source class that I can use?
thanks


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Satish Gopalakrishnan
Ranch Hand

Joined: Feb 13, 2001
Posts: 52
I don't see any replies to your question but were u able to find any such open source code. If so , can you please share the knowledge
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

For XML creation I have a simple XMLWriter class that I developed myself. For more complex import/export, there's the Castor beans classes (http://www.castor.org). Also the latest reference implementation at http://xml.apache.org (xerces) adds a writer capability to the DOM model.


Customer surveys are for companies who didn't pay proper attention to begin with.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
thanks Tim.
Satish, I haven't found anything besides what Tim suggested. I was thinking of using.
PrintWriter outFile=new PrintWriter (new FileWriter....
For the time being, I only need to store the info, so I think this should work
cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create an XML document from a form