Attribute¶
Adds a new attribute with the specified name and value to the current element.
1 | |
Parameters¶
string name
The name of the attribute to add. ( string | number | boolean | DateTimeOffset ) value
The value of the attribute. This value will be XML encoded.
Returns¶
The current XmlWriter instance, allowing for method chaining.
Remarks¶
This method adds a new attribute with the specified name and value to the current element. The value is encoded using XML encoding rules to ensure proper formatting and prevent potential security issues.
Example¶
1 2 3 4 5 6 | |