DotNetBrowser  1.14
Public Member Functions | List of all members
DotNetBrowser.DOM.SearchContext Interface Reference

Base interface for search methods that must be inherited by DOM interfaces that want to have search mechanisms. More...

Inherited by DotNetBrowser.DOM.DOMDocument, and DotNetBrowser.DOM.DOMNode.

Public Member Functions

DOMElement GetElementByTagName (string tagName)
 Finds first DOM element in the current document or element with the given tagName . Returns null if element wasn't found using given find method. More...
 
DOMElement GetElementByName (string name)
 Finds first DOM element in the current document or element with the given name . Returns null if element wasn't found using given find method. More...
 
DOMElement GetElementByClassName (string className)
 Finds first DOM element in the current document or element with the given className . Returns null if element wasn't found using given find method. More...
 
XPathResult Evaluate (string expression)
 Evaluates an XPath expression for the document element with XPathResultType.ANY_TYPE and returns the result. Equivalent of: More...
 
XPathResult Evaluate (string expression, XPathResultType type)
 Returns an XPathResult based on an XPath expression and other given parameters. More...
 

Detailed Description

Base interface for search methods that must be inherited by DOM interfaces that want to have search mechanisms.

Member Function Documentation

XPathResult DotNetBrowser.DOM.SearchContext.Evaluate ( string  expression)

Evaluates an XPath expression for the document element with XPathResultType.ANY_TYPE and returns the result. Equivalent of:

Evaluate(expression, DocumentElement, XPathResultType.ANY_TYPE);
Parameters
expressiona string representing the XPath to be evaluated. Cannot be null or empty string.
Returns
XPathResult object of the type specified in the type parameter. The return value will be always a valid XPathResult object. In case of incorrect expression, the result object will contain information about evaluation error. See the XPathResult.IsError and XPathResult.ErrorMessage properties.
Exceptions
ArgumentExceptionwhen expression is null or empty string.
InvalidOperationExceptionwhen the document element is not available in the current document.
XPathResult DotNetBrowser.DOM.SearchContext.Evaluate ( string  expression,
XPathResultType  type 
)

Returns an XPathResult based on an XPath expression and other given parameters.

Parameters
expressiona string representing the XPath to be evaluated. Cannot be null or empty string.
typetype of result XPathResult to return. See XPathResultType. Cannot be null.
Returns
XPathResult object of the type specified in the type parameter. The return value will be always a valid XPathResult object. In case of incorrect expression, the result object will contain information about evaluation error. See the XPathResult.IsError and XPathResult.ErrorMessage properties.
Exceptions
ArgumentExceptionwhen expression is null or empty string; when contextNode is null; when type is null.
InvalidOperationExceptionwhen the document element is not available in the current document.
DOMElement DotNetBrowser.DOM.SearchContext.GetElementByClassName ( string  className)

Finds first DOM element in the current document or element with the given className . Returns null if element wasn't found using given find method.

Parameters
classNameclassName the class attribute value for a node.
Returns
a list of the matched DOM nodes.
DOMElement DotNetBrowser.DOM.SearchContext.GetElementByName ( string  name)

Finds first DOM element in the current document or element with the given name . Returns null if element wasn't found using given find method.

Parameters
namethe name attribute value for a node.
Returns
a list of the matched DOM nodes.
DOMElement DotNetBrowser.DOM.SearchContext.GetElementByTagName ( string  tagName)

Finds first DOM element in the current document or element with the given tagName . Returns null if element wasn't found using given find method.

Parameters
tagNamethe name of the tag to match on.
Returns
a list of the matched DOM elemnts.