Udostępnij za pośrednictwem


IXPath.Evaluate Method

Definition

Overloads

Evaluate(String, Object)

Evaluate an XPath expression in the specified context and return the result as a String.

Evaluate(String, InputSource)

Evaluate an XPath expression in the context of the specified InputSource and return the result as a String.

Evaluate(String, Object, QName)

Evaluate an XPath expression in the specified context and return the result as the specified type.

Evaluate(String, InputSource, QName)

Evaluate an XPath expression in the context of the specified InputSource and return the result as the specified type.

Evaluate(String, Object)

Evaluate an XPath expression in the specified context and return the result as a String.

[Android.Runtime.Register("evaluate", "(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;", "GetEvaluate_Ljava_lang_String_Ljava_lang_Object_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public string? Evaluate (string? expression, Java.Lang.Object? item);
[<Android.Runtime.Register("evaluate", "(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;", "GetEvaluate_Ljava_lang_String_Ljava_lang_Object_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Evaluate : string * Java.Lang.Object -> string

Parameters

expression
String

The XPath expression.

item
Object

The starting context (node or node list, for example).

Returns

The String that is the result of evaluating the expression and converting the result to a String.

Attributes

Exceptions

If expression cannot be evaluated.

If expression is null.

Remarks

Evaluate an XPath expression in the specified context and return the result as a String.

This method calls #evaluate(String expression, Object item, QName returnType) with a returnType of XPathConstants#STRING.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

If a null value is provided for item, an empty document will be used for the context. If expression is null, then a NullPointerException is thrown.

Java documentation for javax.xml.xpath.XPath.evaluate(java.lang.String, java.lang.Object).

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

Evaluate(String, InputSource)

Evaluate an XPath expression in the context of the specified InputSource and return the result as a String.

[Android.Runtime.Register("evaluate", "(Ljava/lang/String;Lorg/xml/sax/InputSource;)Ljava/lang/String;", "GetEvaluate_Ljava_lang_String_Lorg_xml_sax_InputSource_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public string? Evaluate (string? expression, Org.Xml.Sax.InputSource? source);
[<Android.Runtime.Register("evaluate", "(Ljava/lang/String;Lorg/xml/sax/InputSource;)Ljava/lang/String;", "GetEvaluate_Ljava_lang_String_Lorg_xml_sax_InputSource_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Evaluate : string * Org.Xml.Sax.InputSource -> string

Parameters

expression
String

The XPath expression.

source
InputSource

The InputSource of the document to evaluate over.

Returns

The String that is the result of evaluating the expression and converting the result to a String.

Attributes

Exceptions

If expression cannot be evaluated.

If expression or source is null.

Remarks

Evaluate an XPath expression in the context of the specified InputSource and return the result as a String.

This method calls #evaluate(String expression, InputSource source, QName returnType) with a returnType of XPathConstants#STRING.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

If expression or source is null, then a NullPointerException is thrown.

Java documentation for javax.xml.xpath.XPath.evaluate(java.lang.String, org.xml.sax.InputSource).

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

Evaluate(String, Object, QName)

Evaluate an XPath expression in the specified context and return the result as the specified type.

[Android.Runtime.Register("evaluate", "(Ljava/lang/String;Ljava/lang/Object;Ljavax/xml/namespace/QName;)Ljava/lang/Object;", "GetEvaluate_Ljava_lang_String_Ljava_lang_Object_Ljavax_xml_namespace_QName_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Lang.Object? Evaluate (string? expression, Java.Lang.Object? item, Javax.Xml.Namespace.QName? returnType);
[<Android.Runtime.Register("evaluate", "(Ljava/lang/String;Ljava/lang/Object;Ljavax/xml/namespace/QName;)Ljava/lang/Object;", "GetEvaluate_Ljava_lang_String_Ljava_lang_Object_Ljavax_xml_namespace_QName_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Evaluate : string * Java.Lang.Object * Javax.Xml.Namespace.QName -> Java.Lang.Object

Parameters

expression
String

The XPath expression.

item
Object

The starting context (node or node list, for example).

returnType
QName

The desired return type.

Returns

Result of evaluating an XPath expression as an Object of returnType.

Attributes

Exceptions

If expression cannot be evaluated.

If returnType is not one of the types defined in XPathConstants.

If expression or returnType is null.

Remarks

Evaluate an XPath expression in the specified context and return the result as the specified type.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

If returnType is not one of the types defined in XPathConstants ( XPathConstants#NUMBER NUMBER, XPathConstants#STRING STRING, XPathConstants#BOOLEAN BOOLEAN, XPathConstants#NODE NODE or XPathConstants#NODESET NODESET) then an IllegalArgumentException is thrown.

If a null value is provided for item, an empty document will be used for the context. If expression or returnType is null, then a NullPointerException is thrown.

Java documentation for javax.xml.xpath.XPath.evaluate(java.lang.String, java.lang.Object, javax.xml.namespace.QName).

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

Evaluate(String, InputSource, QName)

Evaluate an XPath expression in the context of the specified InputSource and return the result as the specified type.

[Android.Runtime.Register("evaluate", "(Ljava/lang/String;Lorg/xml/sax/InputSource;Ljavax/xml/namespace/QName;)Ljava/lang/Object;", "GetEvaluate_Ljava_lang_String_Lorg_xml_sax_InputSource_Ljavax_xml_namespace_QName_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Lang.Object? Evaluate (string? expression, Org.Xml.Sax.InputSource? source, Javax.Xml.Namespace.QName? returnType);
[<Android.Runtime.Register("evaluate", "(Ljava/lang/String;Lorg/xml/sax/InputSource;Ljavax/xml/namespace/QName;)Ljava/lang/Object;", "GetEvaluate_Ljava_lang_String_Lorg_xml_sax_InputSource_Ljavax_xml_namespace_QName_Handler:Javax.Xml.Xpath.IXPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Evaluate : string * Org.Xml.Sax.InputSource * Javax.Xml.Namespace.QName -> Java.Lang.Object

Parameters

expression
String

The XPath expression.

source
InputSource

The input source of the document to evaluate over.

returnType
QName

The desired return type.

Returns

The Object that encapsulates the result of evaluating the expression.

Attributes

Exceptions

If expression cannot be evaluated.

If returnType is not one of the types defined in XPathConstants.

If expression, source or returnType is null.

Remarks

Evaluate an XPath expression in the context of the specified InputSource and return the result as the specified type.

This method builds a data model for the InputSource and calls #evaluate(String expression, Object item, QName returnType) on the resulting document object.

See Evaluation of XPath Expressions for context item evaluation, variable, function and QName resolution and return type conversion.

If returnType is not one of the types defined in XPathConstants, then an IllegalArgumentException is thrown.

If expression, source or returnType is null, then a NullPointerException is thrown.

Java documentation for javax.xml.xpath.XPath.evaluate(java.lang.String, org.xml.sax.InputSource, javax.xml.namespace.QName).

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