Documentation ¶
Index ¶
- Constants
- type Attribute
- type Callback
- type CallbackJSON
- type CallbackMap
- type Driver
- type Quote
- type XMLElement
- type XMLParser
- func (x *XMLParser) EnableXpath() *XMLParser
- func (x *XMLParser) ParseAttributesOnly(loopElements ...string) *XMLParser
- func (x *XMLParser) RegisterCallback(match string, callback Callback)
- func (x *XMLParser) RegisterJSONCallback(match string, callback CallbackJSON)
- func (x *XMLParser) RegisterMapCallback(match string, callback CallbackMap)
- func (x *XMLParser) SkipElements(skipElements []string) *XMLParser
- func (x *XMLParser) SkipOuterElements() *XMLParser
- func (x *XMLParser) Stream() error
Constants ¶
View Source
const ( SimpleQuote = "'" DoubleQuotes = "\"" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(*XMLElement) (*XMLElement, error)
func XMLElementToJSONCallback ¶
func XMLElementToJSONCallback(callback CallbackJSON) Callback
func XMLElementToMapCallback ¶
func XMLElementToMapCallback(callback CallbackMap) Callback
XMLElementToMapCallback transforms an XML element into a map, applies a callback function, adds parent attributes, and updates child elements.
type CallbackJSON ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver represents a driver that processes XML using callback functions.
type XMLElement ¶
type XMLElement struct { Name string Attrs map[string]Attribute AttrKeys []string InnerText string Childs map[string][]XMLElement Err error // contains filtered or unexported fields }
func NewXMLElement ¶
func NewXMLElement() *XMLElement
func (*XMLElement) AddAttribute ¶
func (n *XMLElement) AddAttribute(attr Attribute)
func (*XMLElement) FirstChild ¶
func (n *XMLElement) FirstChild() *XMLElement
func (*XMLElement) NextSibling ¶
func (n *XMLElement) NextSibling() *XMLElement
func (*XMLElement) RemoveAttribute ¶ added in v0.1.8
func (n *XMLElement) RemoveAttribute(name string)
func (*XMLElement) RemoveChild ¶ added in v0.1.8
func (n *XMLElement) RemoveChild(name string)
func (*XMLElement) String ¶
func (n *XMLElement) String() string
type XMLParser ¶
type XMLParser struct { TotalReadSize uint64 // contains filtered or unexported fields }
func (*XMLParser) EnableXpath ¶
func (*XMLParser) ParseAttributesOnly ¶
func (*XMLParser) RegisterCallback ¶
func (*XMLParser) RegisterJSONCallback ¶
func (x *XMLParser) RegisterJSONCallback(match string, callback CallbackJSON)
func (*XMLParser) RegisterMapCallback ¶
func (x *XMLParser) RegisterMapCallback(match string, callback CallbackMap)
func (*XMLParser) SkipElements ¶
func (*XMLParser) SkipOuterElements ¶
by default skip elements works for stream elements childs if this method called parser skip also outer elements.
Click to show internal directories.
Click to hide internal directories.