Creating or adding an attribute (xmlAttribute) on a node in c# and Visual Studio 2003
//Add attribute id2
XmlDocument xDocId2 = new XmlDocument();
xDocId2.Load (tmpFilename);
foreach (XmlNode unNodo in xDocId2.DocumentElement.GetElementsByTagName("nodo") )
{
XmlAttribute nAttr;
nAttr = xDocId2.CreateAttribute ("id2");
nAttr.Value= unNodo.Attributes["id"].Value ;
unNodo.Attributes.Append( nAttr);
}
xDocId2.Save(tmpFilename);
3 Comments:
Thanks,
Very helpful!
Steve
2:47 PM
Thank you!
5:56 AM
Obrigado! Foi muito Ăștil!
5:08 AM
Post a Comment
<< Home