Web::DOM::XPathResult
The DOM XPathResult
object
DESCRIPTION
The Web::DOM::XPathResult
class implements the DOM XPathResult
interface.
METHODS
Following methods are available:
$boolean = $result->boolean_value
-
Return the result boolean value. [DOMXPATH]
$boolean = $result->invalid_iterator_state
-
Return whether the result iterator is invalid or not. [DOMXPATH]
$node = $result->iterate_next
-
Return the next Web::DOM::Node of the result iterator, if any, or
undef
. [DOMXPATH] $number = $result->number_value
-
Return the result number value. [DOMXPATH]
$type = $result->result_type
-
Return the result type, i.e. one of constants listed in the "CONSTANTS". [DOMXPATH]
$node = $result->single_node_value
-
Return the result node value, if any, or
undef
. [DOMXPATH] $node = $result->snapshot_item ($index)
-
Return the node at the specified index in the result snapshot, if any, or
undef
. [DOMXPATH] $number = $result->snapshot_length
-
Return the number of nodes in the result snapshot. [DOMXPATH]
$string = $result->string_value
-
Return the result string value. [DOMXPATH]
CONSTANTS
Following result type constants are exported from the Web::DOM::XPathResult module by default.
In addition,
they are accessible as methods of XPathResult
objects.
ANY_TYPE NUMBER_TYPE STRING_TYPE BOOLEAN_TYPE
UNORDERED_NODE_ITERATOR_TYPE ORDERED_NODE_ITERATOR_TYPE
UNORDERED_NODE_SNAPSHOT_TYPE ORDERED_NODE_SNAPSHOT_TYPE
ANY_UNORDERED_NODE_TYPE FIRST_ORDERED_NODE_TYPE
SPECIFICATIONS
- DOMXPATH
-
Document Object Model XPath
<http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult>
.DOM XPath
<http://wiki.whatwg.org/wiki/DOM_XPath>
.743888 - Replace SVGException and XPathException with DOMException
<https://bugzilla.mozilla.org/show_bug.cgi?id=743888#c1>
.The IDL definition MUST be modified as follows:
partial interface XPathResult { readonly attribute (Node or Attr)? singleNodeValue; };
Instead of the
TYPE_ERR
exception, theTypeError
MUST be thrown.If the
resultType
attribute isORDERED_NODE_ITERATOR_TYPE
orUNORDERED_NODE_ITERATOR_TYPE
, any mutation of the nodes whose node document is the document of the context node of the evaluation that results in theXPathResult
object MUST set theinvalidIteratorState
attribute totrue
.
SEE ALSO
AUTHOR
Wakaba <wakaba@suikawiki.org>.
LICENSE
Copyright 2013 Wakaba <wakaba@suikawiki.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.