IXmlPullParser.Require(XmlPullParserNode, String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Test if the current event is of the given type and if the namespace and name do match.
[Android.Runtime.Register("require", "(ILjava/lang/String;Ljava/lang/String;)V", "GetRequire_ILjava_lang_String_Ljava_lang_String_Handler:Org.XmlPull.V1.IXmlPullParserInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void Require(Org.XmlPull.V1.XmlPullParserNode type, string? namespace, string? name);
[<Android.Runtime.Register("require", "(ILjava/lang/String;Ljava/lang/String;)V", "GetRequire_ILjava_lang_String_Ljava_lang_String_Handler:Org.XmlPull.V1.IXmlPullParserInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Require : Org.XmlPull.V1.XmlPullParserNode * string * string -> unit
Parameters
- type
- XmlPullParserNode
The required event type.
- namespace
- String
The required namespace URI, or null to accept any namespace.
- name
- String
The required name, or null to accept any name.
- Attributes
Exceptions
Remarks
Test if the current event is of the given type and if the namespace and name do match. null will match any namespace and any name. If the test is not passed, an exception is thrown. The exception text indicates the parser position, the expected event and the current event that is not meeting the requirement.
Essentially it does this
if (type != getEventType()
|| (namespace != null && !namespace.equals( getNamespace () ) )
|| (name != null && !name.equals( getName() ) ) )
throw new XmlPullParserException( "expected "+ TYPES[ type ]+getPositionDescription());
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.