Discover Packages
github.com/cashapp/hermit
xpath
package
Version:
v0.2.28
Opens a new window with list of versions in this module.
Published: Nov 19, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package xpath is an XPath parser supporting the minimal subset of XPath
used by Hermit. It exists so that only a single selector need be provided
by package triggers, specifying the element to insert and the ability
to find the parent under which to insert if the element does not exist.
nolint: govet
type Attr struct {
Key string `"@" @Ident`
Value *string `("=" @String)?`
}
An Attr on an element in the path.
type Component struct {
Element string `@(Ident | "*")`
Attrs []*Attr `("[" @@ ("and" @@)* "]")?`
}
A Component is an element in a path selector.
Path components.
MustParse parses a subset of XPath or panics.
Parse a subset of XPath used in Hermit.
Parent returns the Path that will select the parent element.
Select matches elements from a tree.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.