NAME

TPath::Context - the context in which a node is evaluated during a search

VERSION

version 1.007

DESCRIPTION

Basically a data structure holding all the different bits of information that may be useful to selectors, predicates, or attributes during the evaluation of a node. This class simplifies method signatures -- instead of passing a list of parameters one passes a single context.

A TPath::Context is a blessed array rather than a hash, and it is a non-Moose class, for a little added efficiency. Note, that for still greater efficiency it is sometimes treated as an array rather than an object, so it must be regarded as a final class not to be tampered with or extended.

METHODS

previous

Returns the context of the node selected immediately before the context node.

first

Returns the first context in the selection history represented by this context.

n

The context node.

i

The TPath::Index.

path

The previous nodes selected in the course of selecting the context node. These ancestor nodes are in reverse order, so the node's immediate predecessor is at index 0.

expression

The expression the context is being used by. This attribute is not guaranteed to be set and the method, unlike the other accessors, is a setter as well as a getter.

The contextual attribute is available for use by TPath::Attributes, which set the attribute when they are applied to a context.

to_string

The stringification of a context is the stringification of its node.

AUTHOR

David F. Houghton <dfhoughton@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by David F. Houghton.

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