XElement::ReplaceAttributes Method
Replaces the attributes of this element with the specified content.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
| Name | Description | |
|---|---|---|
![]() | ReplaceAttributes(Object^) | Replaces the attributes of this element with the specified content. |
![]() | ReplaceAttributes(array<Object^>^) | Replaces the attributes of this element with the specified content. |
This method will raise the Changed and the Changing events.
For details about the valid content that can be passed to this function, see Valid Content of XElement and XDocument Objects1.
The following example creates an element with three attributes. It then uses this method to replace all of the attributes of the element with a single attribute.
This example produces the following output:
<Root NewAtt1="101" />
