• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic