Click or drag to resize

XmlExtensionsSetAttributeValue Method

Safely sets an XML node's attribute.

Namespace: GSF.Xml
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
public static void SetAttributeValue(
	this XmlNode node,
	string name,
	string value
)
View Source

Parameters

node  XmlNode
An XmlNode node to operate on.
name  String
A String indicating the node name to use.
value  String
A String value to set the node attribute's value to.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type XmlNode. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
If you assign a value to an attribute that does not exist, the attribute will be created.
See Also