xml

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SearchSize = 8096
)

Functions

func Marshal

func Marshal(model XMLMarshaler) ([]byte, error)

func Unmarshal

func Unmarshal(d []byte, model XMLUnmarshaler) error

Types

type CharData

type CharData string

type EndTag

type EndTag struct {
	Tagname string
}

func (EndTag) String

func (t EndTag) String() string

type StartTag

type StartTag struct {
	Tagname string
	Attrs   [][2]string
}

func (StartTag) String

func (t StartTag) String() string

type Token

type Token interface{}

type UniversalElement

type UniversalElement struct {
	XMLName  string
	Attrs    [][2]string
	Data     string `xml:",chardata"`
	Children []*UniversalElement
}

func (*UniversalElement) GetElementByIndx

func (u *UniversalElement) GetElementByIndx(indx int) *UniversalElement

func (*UniversalElement) GetElementByName

func (u *UniversalElement) GetElementByName(name string) *UniversalElement

func (*UniversalElement) LenChildren

func (u *UniversalElement) LenChildren() int

func (*UniversalElement) XMLMarshal

func (u *UniversalElement) XMLMarshal(e *XMLEncoder) error

func (*UniversalElement) XMLUnmarshal

func (u *UniversalElement) XMLUnmarshal(e *XMLDecoder, start StartTag) error

type XMLDecoder

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

func NewXMLDecoder

func NewXMLDecoder(d []byte) *XMLDecoder

func (*XMLDecoder) Token

func (xp *XMLDecoder) Token() (Token, error)

type XMLEncoder

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

func NewXMLEncoder

func NewXMLEncoder() *XMLEncoder

func (*XMLEncoder) EncodeToken

func (xp *XMLEncoder) EncodeToken(tkn Token) error

type XMLMarshaler

type XMLMarshaler interface {
	XMLMarshal(e *XMLEncoder) error
}

type XMLUnmarshaler

type XMLUnmarshaler interface {
	XMLUnmarshal(d *XMLDecoder, start StartTag) error
}

Jump to

Keyboard shortcuts

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