Documentation ¶
Overview ¶
Package xml contains functions which wrap encoding/xml.Decoder in the standard library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct { Type TT // Node or Content Name xml.Name // Node name Attributes map[string]string // Node attributes Content xml.CharData // CDATA content Parent *Element // Parent node Children []*Element // List of child nodes and contents for this node }
Element is used to form the tree structure of the Document Object Model.
type XMLDecoder ¶
type XMLDecoder struct { Decoder *xml.Decoder StartElement func(token xml.StartElement) error EndElement func(token xml.EndElement) error CharData func(token xml.CharData) error Comment func(token xml.Comment) error ProcInst func(token xml.ProcInst) error Directive func(token xml.Directive) error }
XMLDecoder is a wrapper around xml.Decoder and holds the functions to be called when tokens are encountered. Functions that are left as nil are skipped by Process().
func NewXMLDecoder ¶
func NewXMLDecoder(r io.Reader) *XMLDecoder
NewXMLDecoder creates a new XMLDecoder that will read from the supplied io.Reader.
func (*XMLDecoder) BuildDOM ¶
func (d *XMLDecoder) BuildDOM() (*Element, error)
BuildDOM inserts its own functions into the decoder in order to build the Domain Object Model.
func (*XMLDecoder) Process ¶
func (d *XMLDecoder) Process() error
Process performs the tokenization of the reader data and calls the user supplied functions.
Click to show internal directories.
Click to hide internal directories.