wood burning stoves*
The moose likes XML and Related Technologies and the fly likes Upload xml to webapplication and parse it using Dom4j Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Upload xml to webapplication and parse it using Dom4j" Watch "Upload xml to webapplication and parse it using Dom4j" New topic
Author

Upload xml to webapplication and parse it using Dom4j

Richard Vagner
Ranch Hand

Joined: Jun 26, 2001
Posts: 107

I have a web page which asks user to upload a xml file from local directory to web application. The webapplication code will take the xml file, parse it and display the contents of the xml. Someone recommend dom4j to me. I guess I can use HTML browse for the local file but not sure how to make the xml file availble to dom4j to parse?

I am new to this, can someone recommend a good approach to do this?

Thanks so much,

Rich
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

I'm not clear on what you are asking. Are you asking how to upload a file?

And why are you asking about parsing? If you only want to display the XML file on the browser after you upload it, there's no parsing necessary. Just copy the file to the response (HTML-escaping it of course).

And if you do want to parse the XML for some reason, then just use one of the XML parsers which are built into the standard Java API for a start. There's no need to confuse the issue by bringing in other parsers until you are more familiar with how to use XML in Java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upload xml to webapplication and parse it using Dom4j