Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nodevalue

Status
Not open for further replies.

jimgao

Programmer
Nov 29, 2000
34
CA
hi,
do anyone know how to modify the data in DOM?
i try the modify the nodevalue, like:
rowNode.Attributes.Item(j).nodeValue = "Modified Data"
but it can't work.
thanks
Jim
 
I don't know the package, but a quick guess would be:


rowNode.Attributes.Item(j).SetValue("ModifiedData") ;

Rose/Miros
 
hi, Rose
thanks , but there is no setvalue method

Jim
 
Hi.

In Visual J++

DOMDocument xDoc=new DOMDocument();
Variant vv=new Variant("f:\\XML_Basiscs\\first.xml");
xDoc.setAsync(false);
xDoc.load(vv);
IXMLDOMElement elem;
elem=xDoc.getDocumentElement();
...set value of node
elem.getChildNodes().getItem(int).setNodeTypedValue(Variant);

It sets the #PCDATA value of the node, but not the attribute!

regards, Kirilla
 
thanks ,Kirilla
but the data is in the attributes, and i found the nodevalue property in MSDN, and it is read/write. it seems we can use that.

Regards,
Jim
 
it works:
oNodeList.Item(5).Attributes.Item(1).nodeValue = "changed"
thanks

Jim
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top