Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
Iter iterates over node sets.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is an item in an xml tree that was compiled to be processed via xml paths. A node may represent:
- An element in the xml document (<body>)
- An attribute of an element in the xml document (href="...")
- A comment in the xml document (<!--...-->)
- A processing instruction in the xml document (<?...?>)
- Some text within the xml document
func ParseDecoder ¶
ParseDecoder parses the xml document being decoded by d and returns its root node.
func ParseHTML ¶
ParseHTML reads an HTML-like document from r, parses it, and returns its root node.
func (*Node) Bytes ¶
Bytes returns the string value of node as a byte slice. See Node.String for a description of what the string value of a node is.
func (*Node) String ¶
String returns the string value of node.
The string value of a node is:
- For element nodes, the concatenation of all text nodes within the element.
- For text nodes, the text itself.
- For attribute nodes, the attribute value.
- For comment nodes, the text within the comment delimiters.
- For processing instruction nodes, the content of the instruction.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a compiled path that can be applied to a context node to obtain a matching node set. A single Path can be applied concurrently to any number of context nodes.
func CompileWithNamespace ¶
Compile the path with the knowledge of the given namespaces
func MustCompile ¶
MustCompile returns the compiled path, and panics if there are any errors.
func (*Path) Bytes ¶
Bytes returns as a byte slice the string value of the first node matched by p on the given context.
See the documentation of Node.String.