Documentation ¶
Index ¶
- type Node
- type NodeNavigator
- func (a *NodeNavigator) Copy() xpath.NodeNavigator
- func (a *NodeNavigator) Current() *Node
- func (a *NodeNavigator) LocalName() string
- func (a *NodeNavigator) MoveTo(other xpath.NodeNavigator) bool
- func (a *NodeNavigator) MoveToChild() bool
- func (a *NodeNavigator) MoveToFirst() bool
- func (a *NodeNavigator) MoveToNext() bool
- func (x *NodeNavigator) MoveToNextAttribute() bool
- func (a *NodeNavigator) MoveToParent() bool
- func (a *NodeNavigator) MoveToPrevious() bool
- func (a *NodeNavigator) MoveToRoot()
- func (a *NodeNavigator) NodeType() xpath.NodeType
- func (a *NodeNavigator) Prefix() string
- func (a *NodeNavigator) String() string
- func (a *NodeNavigator) Value() string
- type NodeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
Parent, PrevSibling, NextSibling, FirstChild, LastChild *Node
Type NodeType
Data string
Value interface{}
// contains filtered or unexported fields
}
A Node consists of a NodeType and some Data (tag name for element nodes, content for text) and are part of a tree of Nodes.
func FindOne ¶
FindOne searches the Node that matches by the specified XPath expr, and returns first element of matched.
func (*Node) ChildNodes ¶
ChildNodes gets all child nodes of the node.
func (*Node) SelectElement ¶
SelectElement finds the first of child elements with the specified name.
type NodeNavigator ¶
type NodeNavigator struct {
// contains filtered or unexported fields
}
NodeNavigator is for navigating JSON document.
func CreateXPathNavigator ¶
func CreateXPathNavigator(top *Node) *NodeNavigator
CreateXPathNavigator creates a new xpath.NodeNavigator for the specified html.Node.
func (*NodeNavigator) Copy ¶
func (a *NodeNavigator) Copy() xpath.NodeNavigator
func (*NodeNavigator) Current ¶
func (a *NodeNavigator) Current() *Node
func (*NodeNavigator) LocalName ¶
func (a *NodeNavigator) LocalName() string
func (*NodeNavigator) MoveTo ¶
func (a *NodeNavigator) MoveTo(other xpath.NodeNavigator) bool
func (*NodeNavigator) MoveToChild ¶
func (a *NodeNavigator) MoveToChild() bool
func (*NodeNavigator) MoveToFirst ¶
func (a *NodeNavigator) MoveToFirst() bool
func (*NodeNavigator) MoveToNext ¶
func (a *NodeNavigator) MoveToNext() bool
func (*NodeNavigator) MoveToNextAttribute ¶
func (x *NodeNavigator) MoveToNextAttribute() bool
func (*NodeNavigator) MoveToParent ¶
func (a *NodeNavigator) MoveToParent() bool
func (*NodeNavigator) MoveToPrevious ¶
func (a *NodeNavigator) MoveToPrevious() bool
func (*NodeNavigator) MoveToRoot ¶
func (a *NodeNavigator) MoveToRoot()
func (*NodeNavigator) NodeType ¶
func (a *NodeNavigator) NodeType() xpath.NodeType
func (*NodeNavigator) Prefix ¶
func (a *NodeNavigator) Prefix() string
func (*NodeNavigator) String ¶
func (a *NodeNavigator) String() string
func (*NodeNavigator) Value ¶
func (a *NodeNavigator) Value() string
Click to show internal directories.
Click to hide internal directories.