Documentation ¶
Index ¶
- type AttributeNode
- type GenericNode
- func (g *GenericNode) AppendAttribute(a *AttributeNode)
- func (g *GenericNode) AppendNode(child *GenericNode)
- func (g *GenericNode) CountChildren() int
- func (g *GenericNode) GetAttributes() []*AttributeNode
- func (g *GenericNode) GetFirstChild() *GenericNode
- func (g *GenericNode) GetLastChild() *GenericNode
- func (g *GenericNode) GetNextSibling() *GenericNode
- func (g *GenericNode) GetPreviousSibling() *GenericNode
- func (g *GenericNode) InsertAttribute(where, a *AttributeNode)
- func (g *GenericNode) InsertNode(where, child *GenericNode)
- func (g *GenericNode) PrependAttribute(a *AttributeNode)
- func (g *GenericNode) PrependNode(child *GenericNode)
- func (g *GenericNode) PrintChildren()
- func (g *GenericNode) PrintXML()
- func (g *GenericNode) PrintXMLPretty()
- func (g *GenericNode) RemoveAllNodes()
- func (g *GenericNode) RemoveAttribute(where *AttributeNode)
- func (g *GenericNode) RemoveFirstAttribute()
- func (g *GenericNode) RemoveFirstNode()
- func (g *GenericNode) RemoveLastAttribute()
- func (g *GenericNode) RemoveLastNode()
- func (g *GenericNode) RemoveNode(where *GenericNode)
- func (g *GenericNode) SendChildElements() (ret chan *GenericNode)
- func (g *GenericNode) SendCloseChildren() (ret chan *GenericNode)
- func (g *GenericNode) String() string
- type NodeType
- type RunXML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeNode ¶
type AttributeNode struct {
// contains filtered or unexported fields
}
AttributeNode represents the attribute (a="abc") of a node
func (*AttributeNode) String ¶
func (a *AttributeNode) String() string
String representation of a attribute node
type GenericNode ¶
type GenericNode struct { NodeType NodeType // NodeType enum (doc, element etc.) // contains filtered or unexported fields }
GenericNode is the datastruct for all "node types" as defined above
func (*GenericNode) AppendAttribute ¶
func (g *GenericNode) AppendAttribute(a *AttributeNode)
AppendAttribute appends an attribute to a node
func (*GenericNode) AppendNode ¶
func (g *GenericNode) AppendNode(child *GenericNode)
AppendNode appends a new child node to a node
func (*GenericNode) CountChildren ¶
func (g *GenericNode) CountChildren() int
CountChildren returns the nodes number of childre. The node itself is not included.
func (*GenericNode) GetAttributes ¶
func (g *GenericNode) GetAttributes() []*AttributeNode
GetAttributes returns a slice of pointers to the attributes of the node
func (*GenericNode) GetFirstChild ¶
func (g *GenericNode) GetFirstChild() *GenericNode
GetFirstChild returns the first child of the node, if no child exists, it returns null
func (*GenericNode) GetLastChild ¶
func (g *GenericNode) GetLastChild() *GenericNode
GetLastChild returns the last child of the node, if no child exists, it returns null
func (*GenericNode) GetNextSibling ¶
func (g *GenericNode) GetNextSibling() *GenericNode
GetNextSibling returns the next sibling of the node, if no siblings exist, or we reached the end of the siblings it returns null
func (*GenericNode) GetPreviousSibling ¶
func (g *GenericNode) GetPreviousSibling() *GenericNode
GetPreviousSibling returns the previous sibling of the node, if no siblings exist, or we reached the first of the siblings it returns null
func (*GenericNode) InsertAttribute ¶
func (g *GenericNode) InsertAttribute(where, a *AttributeNode)
InsertAttribute inserts an attribute before the specified child node
func (*GenericNode) InsertNode ¶
func (g *GenericNode) InsertNode(where, child *GenericNode)
InsertNode inserts a child before the specified child node
func (*GenericNode) PrependAttribute ¶
func (g *GenericNode) PrependAttribute(a *AttributeNode)
PrependAttribute prepends an attribute to the current node
func (*GenericNode) PrependNode ¶
func (g *GenericNode) PrependNode(child *GenericNode)
PrependNode inserts a child as the first node
func (*GenericNode) PrintChildren ¶
func (g *GenericNode) PrintChildren()
PrintChildren prints a representation of the node, including its children
func (*GenericNode) PrintXML ¶
func (g *GenericNode) PrintXML()
PrintXML writes to stdout an XML representation of the node structure.
func (*GenericNode) PrintXMLPretty ¶
func (g *GenericNode) PrintXMLPretty()
PrintXMLPretty writes to stdout an XML representation of the node structure and inserting indenting and line breaking characters for prettier formatting
func (*GenericNode) RemoveAllNodes ¶
func (g *GenericNode) RemoveAllNodes()
RemoveAllNodes removes all child nodes, but not attributes of the current node
func (*GenericNode) RemoveAttribute ¶
func (g *GenericNode) RemoveAttribute(where *AttributeNode)
RemoveAttribute deletes the specified attribute
func (*GenericNode) RemoveFirstAttribute ¶
func (g *GenericNode) RemoveFirstAttribute()
RemoveFirstAttribute deletes the first attribute
func (*GenericNode) RemoveFirstNode ¶
func (g *GenericNode) RemoveFirstNode()
RemoveFirstNode deletes the first child of the node
func (*GenericNode) RemoveLastAttribute ¶
func (g *GenericNode) RemoveLastAttribute()
RemoveLastAttribute delets the last attribute
func (*GenericNode) RemoveLastNode ¶
func (g *GenericNode) RemoveLastNode()
RemoveLastNode deletes the last child of the node
func (*GenericNode) RemoveNode ¶
func (g *GenericNode) RemoveNode(where *GenericNode)
RemoveNode deletes a particular child node of the current node
func (*GenericNode) SendChildElements ¶
func (g *GenericNode) SendChildElements() (ret chan *GenericNode)
SendChildElements returns a channel of pointers to all child elements of the node
func (*GenericNode) SendCloseChildren ¶
func (g *GenericNode) SendCloseChildren() (ret chan *GenericNode)
SendCloseChildren returns a channel of pointers to all direct children, but not their children. This is useful for breadth first parsing
func (*GenericNode) String ¶
func (g *GenericNode) String() string
String representation of a GenericNode
type NodeType ¶
type NodeType int
NodeType is the datatype descriping all possible node types
const ( Document NodeType = iota //!< A document node. Name and value are empty. Element //!< An element node. Name contains element name. Value contains text of first data node. Data //!< A data node. Name is empty. Value contains data text. Cdata //!< A CDATA node. Name is empty. Value contains data text. Comment //!< A comment node. Name is empty. Value contains comment text. Declaration //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. Doctype //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. Pi //!< A PI node. Name contains target. Value contains instructions. )
NodeType enum values
type RunXML ¶
type RunXML struct { ValidateClosingTag bool // contains filtered or unexported fields }
RunXML is the parser instance that tracks the holds all state info
func NewDefaultRunXML ¶
func NewDefaultRunXML() *RunXML
NewDefaultRunXML creates a standard parser setup.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
The rxgen is the command line utility that generates the Unmarshal and Marshal methods of selected structs.
|
The rxgen is the command line utility that generates the Unmarshal and Marshal methods of selected structs. |