• 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

Having problem in modifying the value of node in xml

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to everyone,
Actually i am using XML as database to store value temporarily and later on it will be uploaded on the server and will be updated in the database, but currently i am having following problem.

1. I can save my data in the XML format in the local disk, but when i am editing some part node value, how can i override this value in the xml file.

I am attaching the source code of xml file.


<?xml version="1.0"?>
<VILLAGEINFORMATIONFORM>
<VIF1>
<stateCode>MDI=</stateCode>
<districtCode>MDE=</districtCode>
<blockCode>MDAwMg==</blockCode>
<villageCode>MDAwMTUxMDA=</villageCode>
<tot_no_hbt_village>Nzg3OA==</tot_no_hbt_village>
<no_hbt_prmrystg_school>ODc=</no_hbt_prmrystg_school>
<no_hbt_prmrystg_school_1km>OA==</no_hbt_prmrystg_school_1km>
<no_hbt_prmrystg_school_bnd1km>Nw==</no_hbt_prmrystg_school_bnd1km>
<no_hbt_uprprmrystg_school_within>ODc=</no_hbt_uprprmrystg_school_within>
<no_hbt_uprprmrystg_school_bnd3km>Nzg=</no_hbt_uprprmrystg_school_bnd3km>
<no_hbt_uprprmrystg_school_3km>OA==</no_hbt_uprprmrystg_school_3km>
<no_uncrg_school_prmryuprprmry_class>Nw==</no_uncrg_school_prmryuprprmry_class>
<enrlmnt_uncrg_prmry_stg>ODc=</enrlmnt_uncrg_prmry_stg>
<enrlmnt_uncrg_uprprmry_stg>OA==</enrlmnt_uncrg_uprprmry_stg>
<entered_by>ZGVvMzIwNDE=</entered_by>
<entered_datetime>Mon Sep 13 14:32:18 GMT+05:30 2010</entered_datetime>
<modified_by>ZGVvMzIwNDE=</modified_by>
<modified_datetime>Mon Sep 13 14:32:18 GMT+05:30 2010</modified_datetime>
</VIF1>
<VIF2>
<stateCode>001=</stateCode>
<districtCode>0003=</districtCode>
<blockCode>0001004==</blockCode>
<villageCode>2001=</villageCode>

</VIF2>
<VIF3>
<stateCode>001=</stateCode>
<districtCode>003=</districtCode>
<blockCode>00004==</blockCode>
<villageCode>0001001=</villageCode>
</VIF3>


If i made some changes in the VIF2 using edit form developed in SWING then how can i update it in the XML file.

Can someone please guide me on this, as this is very urgent and i am not getting any clue for this on Google.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I can save my data in the XML format in the local disk,



Exactly how are you doing that? Are you building a Document in memory or just writing text?

I recommend Harold's free online book for examples of this sort of thing.

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

If i made some changes in the VIF2 using edit form developed in SWING then how can i update it in the XML file.



The "edit" process should (1) read the file and (2) create a "new" file with the modification. Basically, the new file replaces the old file.
 
Rajesh k Jha
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello William and Jimmy,

Thanks so much for your attention, I got my problem solved, as I was able to replace the node in memory but not in file, In google i got one help that i want to share with all

and then at last when all setting of node is done in memory
use below code to write it in the file

This will help someone as a solution to someone else...
Thanks again...

This is how we can set the value of
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic