xml

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package xml is an XML converter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct{}

Converter for XML.

func (*Converter) Decode

func (y *Converter) Decode(r io.ReadSeeker) (interface{}, error)

Decode for XML.

func (*Converter) Encode

func (y *Converter) Encode(data interface{}, w io.Writer) error

Encode for XML.

type Doc

type Doc struct {
	Tag        string            `json:"tag_name,omitempty" yaml:"tag_name,omitempty" xml:"tag_name,omitempty"`
	Attributes map[string]string `json:"attributes,omitempty" yaml:"attributes,omitempty" xml:"attributes,omitempty"`
	Children   []*Doc            `json:"children,omitempty" yaml:"children,omitempty" xml:"children,omitempty"`
	Value      string            `json:"value,omitempty" yaml:"value,omitempty" xml:"value,innerxml"`
}

Doc represents an XML tag and children. This is extremely primitive to keep things simple, thus this likely doesn't capture all edge cases.

func (*Doc) UnmarshalXML

func (md *Doc) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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