Share via


IDocument.CreateElementNS(String, String) Method

Definition

Creates an element of the given qualified name and namespace URI.

[Android.Runtime.Register("createElementNS", "(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;", "GetCreateElementNS_Ljava_lang_String_Ljava_lang_String_Handler:Org.W3c.Dom.IDocumentInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Org.W3c.Dom.IElement? CreateElementNS (string? namespaceURI, string? qualifiedName);
[<Android.Runtime.Register("createElementNS", "(Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;", "GetCreateElementNS_Ljava_lang_String_Ljava_lang_String_Handler:Org.W3c.Dom.IDocumentInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateElementNS : string * string -> Org.W3c.Dom.IElement

Parameters

namespaceURI
String

The namespace URI of the element to create.

qualifiedName
String

The qualified name of the element type to instantiate.

Returns

A new Element object with the following attributes: <table border='1' cellpadding='3'> <tr> <th>Attribute</th> <th>Value</th> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Node.nodeName</td> <td valign='top' rowspan='1' colspan='1'> qualifiedName</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Node.namespaceURI</td> <td valign='top' rowspan='1' colspan='1'> namespaceURI</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Node.prefix</td> <td valign='top' rowspan='1' colspan='1'>prefix, extracted from qualifiedName, or null if there is no prefix</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Node.localName</td> <td valign='top' rowspan='1' colspan='1'>local name, extracted from qualifiedName</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Element.tagName</td> <td valign='top' rowspan='1' colspan='1'> qualifiedName</td> </tr> </table>

Attributes

Exceptions

INVALID_CHARACTER_ERR: Raised if the specified qualifiedName is not an XML name according to the XML version in use specified in the Document.xmlVersion attribute.
NAMESPACE_ERR: Raised if the qualifiedName is a malformed qualified name, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "" [] , or if the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "", or if the namespaceURI is "" and neither the qualifiedName nor its prefix is "xmlns".
NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.

Remarks

Creates an element of the given qualified name and namespace URI. <br>Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

Added in DOM Level 2.

Java documentation for org.w3c.dom.Document.createElementNS(java.lang.String, 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