Results 1 to 5 of 5
- 01-19-2012, 02:12 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
Updating XML file with same tag names
I have this xml
------------------------------------
<Results>-
<Result id="1">-
<hometeam>
<Name>Dantooine Destroyers</Name>
<score>23</score>
</hometeam>
<awayteam>
<Name>Wayland Warriors</Name>
<score>3</score>
</awayteam>
</Result>
</Results>
------------------------------------
I want to add the Result element including child nodes again in the same pattern in XML file but different result ID's as shown below.
===========================================
<Results>-
<Result id="1">-
<hometeam>
<Name>Dantooine Destroyers</Name>
<score>23</score>
</hometeam>
<awayteam>
<Name>Wayland Warriors</Name>
<score>3</score>
</awayteam>
</Result>
<Result id="2">-
<hometeam>
<Name>Dantooine Destroyers</Name>
<score>23</score>
</hometeam>
<awayteam>
<Name>Wayland Warriors</Name>
<score>3</score>
</awayteam>
</Result>
</Results>
=====================================
Any help would be appreciated..
Thank you,,,,
- 01-19-2012, 09:29 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Updating XML file with same tag names
It all depends on what you want to do with it.
That will define the parser to use, pretty much, or even whether to bother using a parser (since this could be done with simple file io).
- 01-19-2012, 03:14 PM #3
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
Re: Updating XML file with same tag names
Hi Thanks for your reply. Actually the problem is I am using DOM parser and when I update the file it overwrites the data instead of adding so I was trying to find a way so instead of overwriting it add into it..
- 01-19-2012, 03:34 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: Updating XML file with same tag names
How are you making the changes at the moment then?
- 01-21-2012, 04:57 PM #5
Member
- Join Date
- Jan 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Return search file contents instead of the file names
By rnamboodiri in forum LuceneReplies: 2Last Post: 12-05-2011, 06:15 AM -
Reading In File Names
By Vorsaykal in forum New To JavaReplies: 2Last Post: 11-27-2011, 03:30 AM -
comparing strings in notebook to names of a file
By debz in forum New To JavaReplies: 8Last Post: 02-20-2009, 12:40 PM -
Adding file names(Help!!)
By Gambit17 in forum New To JavaReplies: 4Last Post: 11-09-2007, 07:26 AM -
building file and variable names from variables
By madad2005 in forum New To JavaReplies: 2Last Post: 07-18-2007, 04:47 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks