Org.Xml.Sax.Helpers.NamespaceSupport.DeclarePrefix Method
Declare a Namespace prefix.

Syntax

[Android.Runtime.Register("declarePrefix", "(Ljava/lang/String;Ljava/lang/String;)Z", "GetDeclarePrefix_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual bool DeclarePrefix (string prefix, string uri)

See Also

NamespaceSupport.ProcessName(string, System.String[], System.String[])
NamespaceSupport.GetURI(string)
NamespaceSupport.GetPrefix(string)

Parameters

prefix
The prefix to declare, or the empty string to indicate the default element namespace. This may never have the value "xml" or "xmlns".
uri
The Namespace URI to associate with the prefix.

Returns

Documentation for this section has not yet been entered.

Remarks

Declare a Namespace prefix. All prefixes must be declared before they are referenced. For example, a SAX driver (parser) would scan an element's attributes in two passes: first for namespace declarations, then a second pass using NamespaceSupport.ProcessName(string, System.String[], System.String[]) to interpret prefixes against (potentially redefined) prefixes.

This method declares a prefix in the current Namespace context; the prefix will remain in force until this context is popped, unless it is shadowed in a descendant context.

To declare the default element Namespace, use the empty string as the prefix.

Note that you must not declare a prefix after you've pushed and popped another Namespace context, or treated the declarations phase as complete by processing a prefixed name.

Note that there is an asymmetry in this library: NamespaceSupport.GetPrefix(string) will not return the "" prefix, even if you have declared a default element namespace. To check for a default namespace, you have to look it up explicitly using NamespaceSupport.GetURI(string). This asymmetry exists to make it easier to look up prefixes for attribute names, where the default prefix is not allowed.

[Android Documentation]

Requirements

Namespace: Org.Xml.Sax.Helpers
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1