static AxisIterator createAncestorAxisIterator(XmlObjectNode xmlObjectNode, NodeTest nodeTest, Configuration configuration) { Deque<NodeInfo> ancestors = wrapXmlObjectsAsNodeInfos( xmlObjectNode.getXmlObjectAncestors(), nodeTest, configuration); return new ReverseNodeArrayIterator(ancestors.toArray(new NodeInfo[ancestors.size()]), 0, ancestors.size()); }
static AxisIterator createAncestorOrSelfAxisIterator(XmlObjectNode xmlObjectNode, NodeTest nodeTest, Configuration configuration) { Deque<NodeInfo> ancestorsOrSelf = wrapXmlObjectsAsNodeInfos( xmlObjectNode.getXmlObjectAncestors(), nodeTest, configuration); ancestorsOrSelf.add(wrapXmlObjectAsNodeInfo(xmlObjectNode, configuration)); return new ReverseNodeArrayIterator(ancestorsOrSelf.toArray(new NodeInfo[ancestorsOrSelf.size()]), 0, ancestorsOrSelf.size()); }