• Post Reply Bookmark Topic Watch Topic
  • New Topic

Update perticular tag using stax parser  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
First of all thanks for the previous replies, I really helped me.

Now I have problem with stax parser. I have to update a perticular tag in xml file.
structure of my xml file is as,

<components>
<currInfo>
<os>XP</os>
<language>English</language>
</currInfo>
<preInfo>
<os>Vista</os>
<language>German</language>
</preInfo>
<nextInfo>
<os>Win-98</os>
<language>Russian</language>
</nextInfo>
</components>

In this xml I have to update tags, but how to update tag in perticular parent tag i.e how to update os tag in <nextInfo>
also please suggest the links for this, where I can get sample examples of this type

Please help me and reply soon

thanks in advance
 
Marshal
Posts: 58831
179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult for us beginners. Moving.
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StAX parsing is just another way of reading an XML document as a sequence of events where each event represents a logical part of the document.

The real question is - where is the modified document supposed to go?

Are you writing to a new file, event by event? Perhaps you are ending up with a DOM memory object representing the document and the fact that StAX is involved is not significant.

Harold's chapter (free) on event processing may be helpful.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!