QName Constructors

Definition

Overloads

QName(String)

QName constructor specifying the local part.

QName(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

QName(String, String)

QName constructor specifying the Namespace URI and local part.

QName(String, String, String)

QName constructor specifying the Namespace URI, local part and prefix.

QName(String)

QName constructor specifying the local part.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
public QName (string? localPart);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
new Javax.Xml.Namespace.QName : string -> Javax.Xml.Namespace.QName

Parameters

localPart
String

local part of the QName

Attributes

Remarks

QName constructor specifying the local part.

If the local part is null an IllegalArgumentException is thrown. A local part of "" is allowed to preserve compatible behavior with QName 1.0.

When using this constructor, the Namespace URI is set to javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI and the prefix is set to javax.xml.XMLConstants#DEFAULT_NS_PREFIX XMLConstants.DEFAULT_NS_PREFIX.

<em>In an XML context, all Element and Attribute names exist in the context of a Namespace. Making this explicit during the construction of a QName helps prevent hard to diagnosis XML validity errors. The constructors #QName(String namespaceURI, String localPart) QName(String namespaceURI, String localPart) and #QName(String namespaceURI, String localPart, String prefix) are preferred.</em>

The local part is not validated as a NCName as specified in Namespaces in XML.

Java documentation for javax.xml.namespace.QName.QName(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.

See also

  • <xref:Javax.Xml.Namespace.QName(System.String%2c+System.String)>
  • <xref:Javax.Xml.Namespace.QName(System.String%2c+System.String%2c+System.String)>

Applies to

QName(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected QName (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Javax.Xml.Namespace.QName : nativeint * Android.Runtime.JniHandleOwnership -> Javax.Xml.Namespace.QName

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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

QName(String, String)

QName constructor specifying the Namespace URI and local part.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/String;)V", "")]
public QName (string? namespaceURI, string? localPart);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/String;)V", "")>]
new Javax.Xml.Namespace.QName : string * string -> Javax.Xml.Namespace.QName

Parameters

namespaceURI
String

Namespace URI of the QName

localPart
String

local part of the QName

Attributes

Remarks

QName constructor specifying the Namespace URI and local part.

If the Namespace URI is null, it is set to javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI. This value represents no explicitly defined Namespace as defined by the Namespaces in XML specification. This action preserves compatible behavior with QName 1.0. Explicitly providing the javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI value is the preferred coding style.

If the local part is null an IllegalArgumentException is thrown. A local part of "" is allowed to preserve compatible behavior with QName 1.0.

When using this constructor, the prefix is set to javax.xml.XMLConstants#DEFAULT_NS_PREFIX XMLConstants.DEFAULT_NS_PREFIX.

The Namespace URI is not validated as a URI reference. The local part is not validated as a NCName as specified in Namespaces in XML.

Java documentation for javax.xml.namespace.QName.QName(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.

See also

  • <xref:Javax.Xml.Namespace.QName(System.String%2c+System.String%2c+System.String)>

Applies to

QName(String, String, String)

QName constructor specifying the Namespace URI, local part and prefix.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", "")]
public QName (string? namespaceURI, string? localPart, string? prefix);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", "")>]
new Javax.Xml.Namespace.QName : string * string * string -> Javax.Xml.Namespace.QName

Parameters

namespaceURI
String

Namespace URI of the QName

localPart
String

local part of the QName

prefix
String

prefix of the QName

Attributes

Remarks

QName constructor specifying the Namespace URI, local part and prefix.

If the Namespace URI is null, it is set to javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI. This value represents no explicitly defined Namespace as defined by the Namespaces in XML specification. This action preserves compatible behavior with QName 1.0. Explicitly providing the javax.xml.XMLConstants#NULL_NS_URI XMLConstants.NULL_NS_URI value is the preferred coding style.

If the local part is null an IllegalArgumentException is thrown. A local part of "" is allowed to preserve compatible behavior with QName 1.0.

If the prefix is null, an IllegalArgumentException is thrown. Use javax.xml.XMLConstants#DEFAULT_NS_PREFIX XMLConstants.DEFAULT_NS_PREFIX to explicitly indicate that no prefix is present or the prefix is not relevant.

The Namespace URI is not validated as a URI reference. The local part and prefix are not validated as a NCName as specified in Namespaces in XML.

Java documentation for javax.xml.namespace.QName.QName(java.lang.String, 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