Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Editing an xml

 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to edit an xml(only specified attributes) based on the output from
the applet..so how can i do it...Either by using dom/sax/xpath?
 
shalini gnana
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*How to edit the attribute of the element in an existing xml in java*...Anyone help me,please...
[ March 11, 2008: Message edited by: shalini gnana ]
 
Anuradha Karunamuni
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done this using DOM, but I am not an expert on this subject. Anyway I'll try to help you. Can you please tell what exactly needs to be done in detail.
 
amulya gudapati
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can be done using DOM or SAX parsing
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SAX is just for parsing XML - you can't use it to change XML (unless you want to write code that recreates the complete XML file).

DOM can be used, as could any of the other XML object models (XOM, JDOM, dom4j). See e534 to e538 for examples of how to work with attributes in DOM. See this for how to obtain a DOM Document from an XML file in the first place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic