IDocument.CreateAttribute(String) Method

Definition

Creates an Attr of the given name.

[Android.Runtime.Register("createAttribute", "(Ljava/lang/String;)Lorg/w3c/dom/Attr;", "GetCreateAttribute_Ljava_lang_String_Handler:Org.W3c.Dom.IDocumentInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.W3c.Dom.IAttr? CreateAttribute (string? name);
[<Android.Runtime.Register("createAttribute", "(Ljava/lang/String;)Lorg/w3c/dom/Attr;", "GetCreateAttribute_Ljava_lang_String_Handler:Org.W3c.Dom.IDocumentInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateAttribute : string -> Org.W3c.Dom.IAttr

Parameters

name
String

The name of the attribute.

Returns

A new Attr object with the nodeName attribute set to name, and localName, prefix, and namespaceURI set to null. The value of the attribute is the empty string.

Attributes

Exceptions

INVALID_CHARACTER_ERR: Raised if the specified name is not an XML name according to the XML version in use specified in the Document.xmlVersion attribute.

Remarks

Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttributeNode method. <br>To create an attribute with a qualified name and namespace URI, use the createAttributeNS method.

Java documentation for org.w3c.dom.Document.createAttribute(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to