dynamically how to change attiribute values in xml

Ads
 

dynamically how to change attiribute values in xml

Hi, I am facing the problem to update the Attribute values in XML file.dynamically how to change attribute values in XML . for example below is my XML structure.

text-box 5

I want to change 5 .Default value from '5' to other values dynamically like 1 or 2 or 3 .

Any one please help me resolve the issue.It is very urgent for me.

View Answers

June 7, 2013 at 3:31 PM

hi friend,

Use the following code snippet, may this will be helpful for you.

Node tag = doc.getElementsByTagName("tagName").item(0);
NamedNodeMap tagAttr = tag.getAttributes();
Node nodeAttr = tagAttr.getNamedItem("id");
nodeAttr.setTextContent("3");

Thanks.

Ads









Related Tutorials/Questions & Answers:
dynamically how to change attiribute values in xml
dynamically how to change attiribute values in xml   Hi, I am facing the problem to update the Attribute values in XML file.dynamically how to change attribute values in XML . for example below is my XML structure. text
change xml dynamically
change xml dynamically  How to change an XML dynamically in Java
Advertisements
How to change the checkbox value dynamically.
How to change the checkbox value dynamically.  Hi, I am using struts 1.2 checkbox tag. Requirement is on page load the value must be "true"(checked). And after loading the page i am uncheking the check box and again loading
How to change the data in the table dynamically ?
How to change the data in the table dynamically ?  This is my code. I... then the data displayed in the table below should get sorted dynamically in this jsp page... datastore = DatastoreServiceFactory.getDatastoreService(); Query q = new Query
how to validate values in the dynamically created textboxes?
how to validate values in the dynamically created textboxes?  how to validate values in the dynamically created textboxes in HTML using javascript? Here s my code. Anyone plz help me. Thanks in advance. <!DOCTYPE html PUBLIC
how to read values from java in xml?
how to read values from java in xml?  how to read values from java in xml
how to get the values from dynamically generated textbox in java?
how to get the values from dynamically generated textbox in java?  I... as per the retrieved data) and I want to store textbox values into the two table... to get and update this textbox values into both the tables(Xray,CTScan
How to values from xml using java?
How to values from xml using java?  Hi All, I want to read value from following < Line> xml using java.. In < Line>,data is in format of key and value pair.. i want to read only values..could u plz help me
UITextView Change Height dynamically
UITextView Change Height dynamically  dynamically expand the height of UITextView.   - (void) textViewDidEndEditing:(UITextView *)textView { CGRect frame = mTextView.frame; frame.size.height
How to parse the attributes values from XML using KXML parser in j2me
How to parse the attributes values from XML using KXML parser in j2me  hai team, i did xml parsing from serverside...i got a resultant value from xml,but here tag value name only came from parsing attribute name cant come
How to change the dropdown values based on other dropdown in itext pdf or in any other?
How to change the dropdown values based on other dropdown in itext pdf or in any other?  How to change the drop down values based on another drop..... please provide some suggestions how to do this.. thanks in advance
Can anybody help how to store values to the following xml from .NET application
Can anybody help how to store values to the following xml from .NET application  Can anybody help how to store values to the following xml from .NET application <SQLSchema> <Databases>
retrieving values from dynamically added textboxes in jsp - JSP-Servlet
retrieving values from dynamically added textboxes in jsp  hai friends, iam new to this site ,please help me in this senario in jsp how to retrieve values from dynamically added textbox like we can see in naukri.com
Store values of dynamically generated textboxes into database
Store values of dynamically generated textboxes into database   I'm trying to create a form where the user gives number to generate textboxes. when for example the user enters 3 into textbox, three text boxes get generated
change database values when click next button on jsp page
change database values when click next button on jsp page  How to retrive database values rondomly and display jsp page ,when user click next and previous bottons change the values on jsp page
How to change background, change background
How to change background       This example will teach you to change background of any object... a picture to change background. Selection: Make selection by the Magic wand tool
Reflecting changes in xml files included in jsp page dynamically...
change my data (xml files) dynamically through "service.java" file it does...Reflecting changes in xml files included in jsp page dynamically...  ... way that I can change my xml file and that will be reflected in jsp(next time
Reflecting changes in xml files included in jsp page dynamically...
change my data (xml files) dynamically through "service.java" file it does...Reflecting changes in xml files included in jsp page dynamically...  .... Is there any way that I can change my xml file and that will be reflected in jsp(next time
How to change the face, change the face
How to change the face       You have a chance to learn how to change the face of the person to another face. It has very simple technique to make this effect
Need to retain the values on submiting the form - XML
Need to retain the values on submiting the form  I have created the form using XML and XSL, with textbox,checkbox,textarea and two button submit and RESET. how to retain the values in the same page on clicking submit
how to set the values in jsp
how to set the values in jsp  how to set the values text boxs in jsp frm dbase via servlet
how to change color of titlebar in java
how to change color of titlebar in java  pls help
How to change functionlatiy in web page
How to change functionlatiy in web page  i need to change functionality of my web page..i came to know that by using collections it is possible..but i dont know how to use it...is any other way to change functionality of my web
solution to get values for xml namespace tags from sqldatabase in java
field(" "). how do i get these values.. already connected database and created xml tags in separate file. please provide me solution to get values for xml tags...solution to get values for xml namespace tags from sqldatabase in java 
Want solution to get values for xml namespace tags from database in java
Want solution to get values for xml namespace tags from database in java ... field(" "). how do i get these values.. already connected database and created xml tags in separate file. please provide me solution to get values for xml tags
How to dynamically build a JSON object with Python
How to dynamically build a JSON object with Python  Hi, I have many..., I want full proof method to make json dynamically with Python. How to do this? How to dynamically build a JSON object with Python? Thanks   Hi
How to dynamically build a JSON object with Python
How to dynamically build a JSON object with Python  Hi, I have many..., I want full proof method to make json dynamically with Python. How to do this? How to dynamically build a JSON object with Python? Thanks   Hi
How to change password mask field?
How to change password mask field?  I want to use '*' character in password. thanks in advanced............   password masking character in the standard password field can't be changed
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
Dynamically display values in dropdown box and then show the selected values.... so if I have 5 values in the dropdown this selected one is added as 6th values... selected values directly from the Database and not adding to it as an extra one
how to display selected checkboxes dynamically using jsp
how to display selected checkboxes dynamically using jsp  Hi friends i have a requirement that : in my JSP page i have radio buttons followed by the DB fields..when i click SUBMIT button,if the field(or record
Dynamically display values in dropdown box and then show the selected values as selected by the user which is already stored in the DB
Dynamically display values in dropdown box and then show the selected values..., This is for Updating. I had two SQL queries one for only selected values the user has choosen before and the second SQL query to show all the values. Iwas

Ads