xmlconv

package
v0.0.0-...-255a7ba Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ParaError   = errors.New("parameter invalid")
	FormatError = errors.New("format error")
)

Functions

This section is empty.

Types

type Item

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

func NewFromBytes

func NewFromBytes(b []byte) (*Item, error)

func NewFromString

func NewFromString(s string) (*Item, error)

func NewItem

func NewItem(name string) *Item

func (*Item) Attrs

func (x *Item) Attrs() map[string]string

func (*Item) Bytes

func (x *Item) Bytes() []byte

func (*Item) Children

func (x *Item) Children() map[string]*Item

func (*Item) GetAttr

func (x *Item) GetAttr(a string, defaultValue ...string) (string, bool)

func (*Item) GetChild

func (x *Item) GetChild(n1 string, names ...string) (c *Item, exist bool)

func (*Item) Marshal

func (self *Item) Marshal(opt ...Option) (string, error)

func (*Item) MarshalBytes

func (self *Item) MarshalBytes(opt ...Option) ([]byte, error)

func (*Item) MarshalString

func (self *Item) MarshalString(opt ...Option) (string, error)

func (*Item) Name

func (x *Item) Name() string

func (*Item) SetAttr

func (x *Item) SetAttr(n, v string)

func (*Item) SetChild

func (x *Item) SetChild(child *Item, n1 string, names ...string) *Item

func (*Item) SetChildBytes

func (x *Item) SetChildBytes(b []byte, n1 string, names ...string) *Item

func (*Item) SetChildString

func (x *Item) SetChildString(s string, n1 string, names ...string) *Item

func (*Item) SetData

func (x *Item) SetData(b []byte)

func (*Item) SetEmptyChild

func (x *Item) SetEmptyChild(n1 string, names ...string) *Item

func (*Item) SetString

func (x *Item) SetString(s string)

func (*Item) String

func (x *Item) String() string

type Option

type Option struct {
	Indent string
}

Jump to

Keyboard shortcuts

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