pub enum XPathExpr {
DescendantByTag(Tag),
DescendantByAttr {
tag: Tag,
attr: String,
value: String,
},
DescendantByAttrExists {
tag: Tag,
attr: String,
},
AbsolutePath(Vec<PathStep>),
ContainsPredicate {
tag: Tag,
attr: String,
substr: String,
},
PositionPredicate {
tag: Tag,
pos: usize,
},
TextExtract(Box<XPathExpr>),
DescendantWildcard,
DescendantWildcardByAttr {
attr: String,
value: String,
},
DescendantWildcardByAttrExists {
attr: String,
},
Parent,
}Expand description
A parsed XPath expression.
Variants§
DescendantByTag(Tag)
//tag — find descendants by tag name.
DescendantByAttr
//tag[@attr='value'] — find descendants by tag with an attribute
predicate.
DescendantByAttrExists
//tag[@attr] — descendants by tag with attribute existence predicate.
AbsolutePath(Vec<PathStep>)
/path/to/tag — absolute path from root.
ContainsPredicate
//tag[contains(@attr, 'substr')] — find descendants by tag with a
contains predicate.
Fields
PositionPredicate
//tag[position()=N] — find descendants by tag at a specific position.
TextExtract(Box<XPathExpr>)
//tag/text() or expression/text() — extract text from matched nodes.
DescendantWildcard
* in descendant context — //\*
DescendantWildcardByAttr
//\*[@attr='value'] — wildcard with attribute predicate.
DescendantWildcardByAttrExists
//\*[@attr] — wildcard with attribute existence predicate.
Parent
.. — parent axis (relative to a context node).
Trait Implementations§
impl StructuralPartialEq for XPathExpr
Auto Trait Implementations§
impl Freeze for XPathExpr
impl RefUnwindSafe for XPathExpr
impl Send for XPathExpr
impl Sync for XPathExpr
impl Unpin for XPathExpr
impl UnsafeUnpin for XPathExpr
impl UnwindSafe for XPathExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more