Tools for navigating element trees.
Provides the Cursor class for navigating and retrieving nodes identified using a limited path language.
Sequence
Mapping
itertools0
functools0
comethod0
keywords0
InvalidPath0
Path string given to Context.prepare was not valid.
iselement0
iselement(subject)
Determines whether the given object has the properties of an element.
Context0
Query expression context for parsing and interpreting paths.
Contextprepare0
prepare(self, path)
Parse the path string into a selection plan.
Context_paths_profile0
_paths_profile = keywords.Profile.from_keywords_v1(
routers = ["/"],
operations = [
"*", # Match any immediate descendant.
"#", # Slice nodes. 1-based, inclusive.
"?", # Apply context designated filter.
"\\\\", # Escape backslash in predicate string.
"\\]", # Escape predicate close.
"|",
],
terminators = [],
enclosures = [],
literals = [
["[", "]"], # Predicates are text strings.
],
)
Context_parser0
_parser = keywords.Parser.from_profile(_paths_profile).process_document
Context__init__0
__init__(self, selectors, aliases)
Context_identify_node0
_identify_node(predicate, node)
Context_parse_slice0
_parse_slice(string)
Context_read_string280%
_read_string(itokens)
Contextstructure888%
structure(self, tokens)
Process tokens into selector sequences. Usually used indirectly by prepare.
Context_select0
_select(self, nodes, ident)
Context_index0
_index(self, nodes, eslice)
Context_predicate0
_predicate(self, nodes, title)
Context_all0
_all(self, nodes, type)
Context_filter275%
_filter(self, nodes, *spec)
Context_union0
_union(self, origin_nodes, exprnodes)
Contextswitch0
switch(self, operation, nodes)
Contextinterpret0
interpret(self, plan, root, context)
Cursor0
Navigation state class providing a query interface to an element tree.
Cursor__init__0
__init__(self, context, root)
Cursorseek0
seek(self, path)
Adjust the cursor position to the nodes identified by path.
Cursorreset0
reset(self)
Select the root as the current working node.
Cursorfork0
fork(self, path)
Create a new instance using the given path to the select the nodes used as the root content of the new Cursor.
Cursorselect0
select(self, path)
Retrieve nodes relative to the context node using path.