wichosaenz
Posts: 15
|
Posted: 02/05/2009, 9:04 AM |
|
Well i was using two way:
Change the Value of an Attribute
In the DOM, attributes are nodes. Unlike element nodes, attribute nodes have text values.
The way to change the value of an attribute, is to change its text value.
This can be done using the setAttribute() method or using the nodeValue property of the attribute node.
Change an Attribute Using setAttribute()
The setAttribute() method changes the value of an existing attribute, or creates a new attribute.
xmlDoc=loadXMLDoc("FlashChart.xml");
x=xmlDoc.getElementsByTagName('Title');
x[0].setAttribute("text","El titulo del Flash Chart que yo deseo");
Change an Attribute Using nodeValue
The nodeValue property can be used to change the value of a attribute node:
xmlDoc=loadXMLDoc("FlashChart.xml");
x=xmlDoc.getElementsByTagName("Title")[0]
y=x.getAttributeNode("text");
y.nodeValue="El titulo del Flash Chart que yo deseo";
And this you can modify the XML file in the FlashChart
|