Documentation ¶
Overview ¶
Package node provides helper functions to work with queryxml.Node pointers.
All functions explicitly handle nil nodes and therefore allow for deep nesting of these function calls.
Index ¶
- func AppendChild(p, c *xmlquery.Node)
- func Data(node *xmlquery.Node) string
- func Delete(n *xmlquery.Node)
- func FirstChild(node *xmlquery.Node) *xmlquery.Node
- func LookupAttr(node *xmlquery.Node, key xml.Name) (string, bool)
- func LookupAttrAsFloat(node *xmlquery.Node, key xml.Name) (float64, bool)
- func LookupAttrAsInt(node *xmlquery.Node, key xml.Name) (int, bool)
- func Parent(node *xmlquery.Node) *xmlquery.Node
- func PrependChild(p, c *xmlquery.Node)
- func PrependSibling(n, s *xmlquery.Node)
- func PrettyPrint(node *xmlquery.Node, prefix, indent string) string
- func Query(node *xmlquery.Node, expr string) (*xmlquery.Node, error)
- func QueryAll(node *xmlquery.Node, expr string) ([]*xmlquery.Node, error)
- func SetAttr(node *xmlquery.Node, attr xml.Attr)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendChild ¶
AppendChild appends the child c to the parent p. Both given nodes must not be null.
func FirstChild ¶
FirstChild returns the first child of the node or nil if the node is nil.
func LookupAttr ¶
LookupAttr looks up an attribute by its key and if the key was found.
func LookupAttrAsFloat ¶
LookupAttrAsFloat looks up an attribute by its key and interprets it as a float.
func LookupAttrAsInt ¶
LookupAttrAsInt looks up an attribute by its key and interprets it as an int.
func PrependChild ¶
PrependChild prepends the child c to the parent p. Both given nodes must not be null.
func PrependSibling ¶
PrependSibling prepends to the node n a new sibling s. Both given nodes must not be null.
func PrettyPrint ¶ added in v0.0.22
PrettyPrint pretty prints the given node and returns it. If the given node is nil, an empty string is returned.
Types ¶
This section is empty.