• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Upload xml to webapplication and parse it using Dom4j

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Sheriff
Posts: 27235
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic