• 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

Update perticular tag using stax parser

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too difficult for us beginners. Moving.
 
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
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
 
For my next feat, I will require a volunteer from the audience! Perhaps this 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