XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 27th, 2003, 11:06 PM
srivalli9 srivalli9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 48 srivalli9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
Using JAXP API and SAX parser, how to change an attribute value in an XML file

Hello,

When using JAXP API with SAX parser(xerces), how can I manipulate the XML file?
Specifically, how can I change an attribute value of an element?

I could reach the element and print its value, but failed to find a method to change it.

Can anyone please help me?

Thanks in advance.

Here is a code fragment..........
______________________________________________
public void startElement(String namespace, String eleName, String raw, Attributes attributes) throws SAXException{
if(attributes!=null){
for(int i=0;i<attributes.getLength();++i){
if(attributes.getLocalName(i).equals("credrating")){
credrating=attributes.getValue(i);
attributes.setValue();
}
designation="not good";
if((attributes.getLocalName(i).equals("good"))&&(attributes.getValue(i).equals("Yes")))
designation="good";
}
}
}
}

_____________________________________________

I wanted to change the value of the attribute "creditrating"

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Using JAXP API and SAX parser, how to change an attribute value in an XML file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway