I ha开发者_StackOverflowve an XElement object which has a number of attributes and I simply want to add another attribute to the element.
How do I do this?
xElement.Add(new XAttribute("Foo", "Bar"));
To create an element with an attribute use:
var xmlTest = new XElement("XmlElementName", new XAttribute("XmlAttributeName", "AttributeValue"));
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论