Sdílet prostřednictvím


IXmlPullParser.SetFeature(String, Boolean) Method

Definition

Use this call to change the general behaviour of the parser, such as namespace processing or doctype declaration handling.

[Android.Runtime.Register("setFeature", "(Ljava/lang/String;Z)V", "GetSetFeature_Ljava_lang_String_ZHandler:Org.XmlPull.V1.IXmlPullParserInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetFeature (string? name, bool state);
[<Android.Runtime.Register("setFeature", "(Ljava/lang/String;Z)V", "GetSetFeature_Ljava_lang_String_ZHandler:Org.XmlPull.V1.IXmlPullParserInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetFeature : string * bool -> unit

Parameters

name
String
state
Boolean
Attributes

Exceptions

If the feature is not supported or can not be set

If string with the feature name is null

Remarks

Use this call to change the general behaviour of the parser, such as namespace processing or doctype declaration handling. This method must be called before the first call to next or nextToken. Otherwise, an exception is thrown.

Example: call setFeature(FEATURE_PROCESS_NAMESPACES, true) in order to switch on namespace processing. The initial settings correspond to the properties requested from the XML Pull Parser factory. If none were requested, all features are deactivated by default.

Java documentation for org.xmlpull.v1.XmlPullParser.setFeature(java.lang.String, boolean).

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