Documentation
¶
Overview ¶
Package xpathparser provides lexer and parser for XPath 1.0.
This Package parses given XPath expression to expression model.
An example of using this package:
expr := xpathparser.MustParse("(/a/b)[5]") fmt.Println(expr)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Axis ¶
type Axis int
Axis specifies the tree relationship between the nodes selected by the location step and the context node.
type BinaryExpr ¶
BinaryExpr represents a binary operation.
func (*BinaryExpr) String ¶
func (b *BinaryExpr) String() string
type Error ¶
Error is the error type returned by Parse function.
It represents a syntax error in the XPath expression.
type Expr ¶
type Expr interface{}
An Expr is an interface holding one of the types: *LocationPath, *FilterExpr, *PathExpr, *BinaryExpr, *NegateExpr, *VarRef, *FuncCall, Number or String
type FilterExpr ¶
FilterExpr represents https://www.w3.org/TR/xpath/#NT-FilterExpr.
func (*FilterExpr) String ¶
func (f *FilterExpr) String() string
type FuncCall ¶
FuncCall represents https://www.w3.org/TR/xpath/#section-Function-Calls.
type LocationPath ¶
LocationPath represents XPath location path.
func (*LocationPath) String ¶
func (lp *LocationPath) String() string
type NameTest ¶
NameTest represents https://www.w3.org/TR/xpath/#NT-NameTest.
type NegateExpr ¶
type NegateExpr struct {
Expr Expr
}
NegateExpr represents unary operator `-`.
func (*NegateExpr) String ¶
func (n *NegateExpr) String() string
type NodeTest ¶
type NodeTest interface{}
A NodeTest is an interface holding one of the types: NodeType, *NameTest, or PITest.
type PathExpr ¶
type PathExpr struct { Filter Expr LocationPath *LocationPath }
PathExpr represents https://www.w3.org/TR/xpath/#NT-PathExpr.