The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::Object::XPath::Step - HTML Object XPath Step

SYNOPSIS

    use HTML::Object::XPath::Step;
    my $this = HTML::Object::XPath::Step->new || die( HTML::Object::XPath::Step->error, "\n" );

VERSION

    v0.2.0

DESCRIPTION

This module represents a XPath step.

CONSTRUCTOR

new

It takes a HTML::Object::XPath object, an axis, a test name and a literal and returns a new HTML::Object::XPath::Step object.

METHODS

as_string

Returns a string representation of the step.

as_xml

Returns a string representation of the step as xml.

axis

Set or get the axis.

axis_ancestor

Provided with a context and a HTML::Object::XPath::NodeSet object, and this will add each parent until there are none found anymore, to the resulting node set and returns it.

axis_ancestor_or_self

This performs a similar function as "axis_ancestor", except it test each node and add it to the result, before going up to the next parent.

axis_attribute

Provided with a context and a node set and this will add each of its attribute object to the resulting node set and returns it.

axis_child

Provided with a context and a HTML::Object::XPath::NodeSet object, and this will add each of the children's node and returns the resulting set.

axis_descendant

Provided with a context and a HTML::Object::XPath::NodeSet object, and this will add each of the children's node and its children after that until there is none and returns the resulting set.

axis_descendant_or_self

This performs a similar function as "axis_ancestor", except it test each node and add it to the result, before going down to the next children's nodes.

axis_following

Provided with a context and a node set and this will get all the first child in the tree of the element's next sibling.

axis_following_sibling

Provided with a context and a node set and this will add its next sibling to the resulting node set and its sibling sibling and so forth. It returns the resulting node set.

axis_method

Set or get the axis method.

axis_namespace

Provided with a context and a node set and this will add each namespace of the context into the result.

axis_parent

Provided with a context and a node set and this will psh to the result array the context's parent, if any. It returns the resulting node set.

axis_preceding

Provided with a context and a node set and this will get all the last child of the previous sibling hierarchy. It returns the resulting node set.

axis_preceding_sibling

Provided with a context and a node set and this will all the previous siblings recursively. It returns the resulting node set.

axis_self

Provided with a context and a node set and this will return the node set with the provided context added to it.

evaluate

Provided with a node set or a node and this will evaluate each element of the nod set by calling "evaluate_node" for each of them and adding the result to a new node set and returns it.

evaluate_node

Provided with a context and this will evaluate the context, by calling the method set in "axis_method" and passing it the context and a new node set. It returns the new node set.

filter_by_predicate

Provided with a node set and a predicate and this will evaluate each element in the node set with the predicate. Based on the result, it will add the node evaluated to a new node set that is returned.

literal

Set or get the literal value.

new_nodeset

Returns a new node set object passing it whatever arguments was provided.

node_test

Provided with a node and this will test it based on the test set for this step and return a certain value; most of the time a simple true value.

test

Set or get the test name (or actually number) to be performed.

test_attribute

Provided with a node and this will test its attribute.

test_namespace

Provided with a node and this will test its name space.

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

HTML::Object::XPath, HTML::Object::XPath::Boolean, HTML::Object::XPath::Expr, HTML::Object::XPath::Function, HTML::Object::XPath::Literal, HTML::Object::XPath::LocationPath, HTML::Object::XPath::NodeSet, HTML::Object::XPath::Number, HTML::Object::XPath::Root, HTML::Object::XPath::Step, HTML::Object::XPath::Variable

COPYRIGHT & LICENSE

Copyright(c) 2021 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.