Skip to main content

preceding

Function preceding 

Source
pub fn preceding<'a, N: Node<'a>>(n: N) -> impl Iterator<Item = N> + 'a
Expand description

preceding axis (reverse): “contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes”.

A context node that is itself an attribute/namespace node reduces to its owner element: since attribute/namespace nodes are excluded from the result set regardless, and everything else before the attribute in document order is exactly everything before its owner element, preceding(attr) == preceding(owner).