This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Edit xml(rendered as html) file and again save it

 
Sandeep. Oza
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
In my java-jsp application, I am displaying xml file on the browser as html rendering using CSS.
Now I want to make change in data(content) of few predefined tags(fields).
And again save this xml(html to xml) file.
So how to make this editable...??? How to transform html to xml and save...??
Pl. help.
Thanks in advance.
Sandeep Oza
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could put the XML into an HTML textarea, let the user edit the XML there and then submit the form/change.
 
Sandeep. Oza
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Lasse.
My xml file is very large having lot of tags with attributes... I want to display it as user friendly.. In TextArea, it will not get displayed properly and second thing is that, the user who modify it..is not technical. If he change any tags... or delete any tags... anything.. then xml will not parse...I want to display some predefined fields, whose data(content) can be change .. not the tag also.
Else for smaller file your approach is the best.
Sandeep Oza
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you have to vary only a set of elements value of the whole big xml file.
You can provide a small user interface(form based) to the user to edit the existing data, update the xml upon submit click.
Since you are using CSS encoding within XML, you can just use a jsp/servlet to read and write the xml file to the PrintWriter, which shd automatically show the HTML on the browser.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic