xmlx

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidDocument invalid document err
	ErrInvalidDocument = errors.New("xmlx: invalid document")

	// ErrInvalidRoot data at the root level is invalid err
	ErrInvalidRoot = errors.New("xmlx: data at the root level is invalid")
)

Functions

func Decode

func Decode(r io.Reader) (map[string]any, error)

Decode xml reader to map[string]any

func DecodeBytes

func DecodeBytes(bs []byte) (map[string]any, error)

DecodeBytes xml bytes to map[string]any

func DecodeString

func DecodeString(s string) (map[string]any, error)

DecodeString xml string to map[string]any

Types

type MapDecoder

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

MapDecoder a xml decoder for map[string]any

func NewMapDecoder

func NewMapDecoder(attrPrefix, textKey string) *MapDecoder

NewMapDecoder create new decoder instance with custom attribute prefix and text key

func (*MapDecoder) Decode

func (d *MapDecoder) Decode(r io.Reader) (map[string]any, error)

Decode xml string to map[string]any

Jump to

Keyboard shortcuts

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