Versions in this module Expand all Collapse all v0 v0.0.1 Aug 24, 2022 Changes in this version + var DisableSelectorCache = false + var SelectorCacheMaxEntries = 50 + func AddAttr(n *Node, key, val string) + func AddChild(parent, n *Node) + func AddSibling(sibling, n *Node) + func FindEach(top *Node, expr string, cb func(int, *Node)) + func FindEachWithBreak(top *Node, expr string, cb func(int, *Node) bool) + func RemoveFromTree(n *Node) + type Attr struct + Name xml.Name + NamespaceURI string + Value string + type DecoderOptions struct + AutoClose []string + Entity map[string]string + Strict bool + type Node struct + Attr []Attr + Data string + FirstChild *Node + LastChild *Node + NamespaceURI string + NextSibling *Node + Parent *Node + Prefix string + PrevSibling *Node + Type NodeType + func Find(top *Node, expr string) []*Node + func FindOne(top *Node, expr string) *Node + func LoadURL(url string) (*Node, error) + func Parse(r io.Reader) (*Node, error) + func ParseWithOptions(r io.Reader, options ParserOptions) (*Node, error) + func Query(top *Node, expr string) (*Node, error) + func QueryAll(top *Node, expr string) ([]*Node, error) + func QuerySelector(top *Node, selector *xpath.Expr) *Node + func QuerySelectorAll(top *Node, selector *xpath.Expr) []*Node + func (n *Node) InnerText() string + func (n *Node) OutputXML(self bool) string + func (n *Node) SelectAttr(name string) string + func (n *Node) SelectElement(name string) *Node + func (n *Node) SelectElements(name string) []*Node + func (n *Node) SetAttr(key, value string) + func (n *Node) UnsetAttr(key string) + type NodeNavigator struct + func CreateXPathNavigator(top *Node) *NodeNavigator + func (x *NodeNavigator) Copy() xpath.NodeNavigator + func (x *NodeNavigator) Current() *Node + func (x *NodeNavigator) LocalName() string + func (x *NodeNavigator) MoveTo(other xpath.NodeNavigator) bool + func (x *NodeNavigator) MoveToChild() bool + func (x *NodeNavigator) MoveToFirst() bool + func (x *NodeNavigator) MoveToNext() bool + func (x *NodeNavigator) MoveToNextAttribute() bool + func (x *NodeNavigator) MoveToParent() bool + func (x *NodeNavigator) MoveToPrevious() bool + func (x *NodeNavigator) MoveToRoot() + func (x *NodeNavigator) NamespaceURL() string + func (x *NodeNavigator) NodeType() xpath.NodeType + func (x *NodeNavigator) Prefix() string + func (x *NodeNavigator) String() string + func (x *NodeNavigator) Value() string + type NodeType uint + const AttributeNode + const CharDataNode + const CommentNode + const DeclarationNode + const DocumentNode + const ElementNode + const TextNode + type ParserOptions struct + Decoder *DecoderOptions + type StreamParser struct + func CreateStreamParser(r io.Reader, streamElementXPath string, streamElementFilter ...string) (*StreamParser, error) + func CreateStreamParserWithOptions(r io.Reader, options ParserOptions, streamElementXPath string, ...) (*StreamParser, error) + func (sp *StreamParser) Read() (*Node, error)