libxml

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GrabTargetsFromXML

func GrabTargetsFromXML(reader io.Reader, streamParser XMLInstanceGrabber) error

Parse XML from io.Reader interface with XmlStreamParser

func ParseXMLFile

func ParseXMLFile(fileName string, streamParser interface{}) error

Parse XML from fileName with XmlStreamParser

func ParseXMLReader

func ParseXMLReader(reader io.Reader, streamParser XmlStreamParser) error

Parse XML from io.Reader interface with XmlStreamParser

Types

type XMLInstanceGrabber

type XMLInstanceGrabber interface {
	SetName(xml.Name)
	GetName() xml.Name
	MakeInstance() interface{}
	ProcessInstance(interface{}) error
}

type XmlGrabber

type XmlGrabber struct {
	// contains filtered or unexported fields
}

func NewXmlGrabber

func NewXmlGrabber(tag string, ns string, makeInstanceFun XmlGrabberMakeInstanceFun, processInstanceFun XmlGrabberProcessInstanceFun) *XmlGrabber

func NewXmlTargetGrabber

func NewXmlTargetGrabber(tag string, ns string, target interface{}, processInstanceFun XmlGrabberProcessInstanceFun) *XmlGrabber

func (XmlGrabber) GetName

func (x XmlGrabber) GetName() xml.Name

func (*XmlGrabber) MakeInstance

func (x *XmlGrabber) MakeInstance() interface{}

func (*XmlGrabber) ProcessInstance

func (x *XmlGrabber) ProcessInstance(i interface{}) error

func (*XmlGrabber) SetName

func (x *XmlGrabber) SetName(name xml.Name)

type XmlGrabberMakeInstanceFun

type XmlGrabberMakeInstanceFun func() interface{}

type XmlGrabberProcessInstanceFun

type XmlGrabberProcessInstanceFun func(interface{}) error

type XmlStreamParser

type XmlStreamParser interface {
	ProcessStartElement(xml.StartElement) error
	ProcessEndElement(xml.EndElement) error
	ProcessCharData(xml.CharData) error
	ProcessComment(xml.Comment) error
	ProcessProcInst(xml.ProcInst) error
	ProcessDirective(xml.Directive) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL