Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Node ¶
Node represents a XML tree, which can have subnodes and connets it to its parent node.
If the Token is of type xml.StartElement, it can have Nodes (children) of other nodes with different types, but has to end with a node of type xml.EndElement. Example:
Token: xml.StartElement Nodes: [xml.CharData, xml.Comment, xml.StartElement, xml.Comment, xml.EndElement] \ \Token: xml.StartElement \Nodes: [xml.CharData, xml.EndElement]
This creates a tree like this:
CharData Comment StartNode A CharData StartNode B CharData EndNode B CharData EndNode A CharData
func GetParent ¶
GetParent returns the first parent node of the given child, having the given localName.
func (*Node) Append ¶
Append adds the given token to the node childrens list, returning the newly appended child.
func (*Node) Dump ¶
Dump returns the node structure in a human readable format. The format can change between versions.
func (*Node) MarshalXML ¶
MarshalXML implements the xml.Marshaler interface, so Node objects can be marshalled conveniently with `xml.Marshal(node)`. The output of marshal should result semantically to the originally parsed document.