Org.XmlPull.V1.IXmlSerializer.SetPrefix Method
Binds the given prefix to the given namespace.

Syntax

[Android.Runtime.Register("setPrefix", "(Ljava/lang/String;Ljava/lang/String;)V", "GetSetPrefix_Ljava_lang_String_Ljava_lang_String_Handler:Org.XmlPull.V1.IXmlSerializerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetPrefix (string prefix, string namespace)

Parameters

prefix
must be not null (or IllegalArgumentException is thrown)
namespace
must be not null

Exceptions

TypeReason
Java.IO.IOException
Java.Lang.IllegalArgumentException
Java.Lang.IllegalStateException

Remarks

Binds the given prefix to the given namespace. This call is valid for the next element including child elements. The prefix and namespace MUST be always declared even if prefix is not used in element (startTag() or attribute()) - for XML 1.0 it must result in declaring xmlns:prefix='namespace' (or xmlns:prefix="namespace" depending what character is used to quote attribute value).

NOTE: this method MUST be called directly before startTag() and if anything but startTag() or setPrefix() is called next there will be exception.

NOTE: prefixes "xml" and "xmlns" are already bound and can not be redefined see: .

NOTE: to set default namespace use as prefix empty string.

[Android Documentation]

Requirements

Namespace: Org.XmlPull.V1
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1