Heh, had a mistake in the last msg, sorry, no CreateChile for node. Correct
way:
1. Create the attribute: XmlAttribute attr = doc.CreateAttribute("newattribute");
2. Append one: xmlNode.Attributes.Append(attr);
The value can be set after both steps.
Regards, Alex
[TechBlog]
http://devkids.blogspot.com
AMHi CSharper,
AM>
AMFirst create the attribute, like
AMxmldoc.CreateAttribute("newattribute"), update it and, then, add it
AMby CreateChild.
AM>
AMRegards, Alex
AM[TechBlog]
http://devkids.blogspot.com
C>I am reading an XmlFile using XmlDocument and traverse through the
C>XmlNode, as I read I need to append an attribute to the XmlNode on
C>some conditions.
C>>
C>I tried xmlNode.Attributes.Append()
C>>
C>It takes only XmlAttribute and in this when I create a new
C>XmlAttribute, it doesn't allow me to set the name and value as the
C>name is only the readonly value. How can I achive this?
C>>