xqml

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultRootTag    = "root"
	DefaultElementTag = "element"
)

Variables

This section is empty.

Functions

func Stringify

func Stringify(v any) string

Types

type Xqml

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

func NewXQML

func NewXQML() *Xqml

func (*Xqml) Decoder

func (x *Xqml) Decoder(e *xml.Decoder)

Decoder allows to set a customer xml decoder. Default decoder has Strict = true and Entity = xml.HTMLEntity.

func (*Xqml) Element

func (x *Xqml) Element(s string)

Element allows to set default element tag name in <root><element>...</element></root>. It used only with WriteXml([]value).

func (*Xqml) Encoder

func (x *Xqml) Encoder(e *xml.Encoder)

Encoder allows to set a customer xml encoder.

func (*Xqml) ForceList

func (x *Xqml) ForceList(s ...string)

ForceList allows to ensure some elements are parsed as slice, even when only one element is present.

func (*Xqml) Indent

func (x *Xqml) Indent(s string)

Indent allows to set indent string. Use "" for compact write.

func (*Xqml) Namespace

func (x *Xqml) Namespace(b bool)

Namespace allows to keep namespaces. Default is to keep namespaces, use Namespace(false) to remove them.

func (*Xqml) ParseXml

func (x *Xqml) ParseXml(reader io.Reader, cast bool) (map[string]any, error)

func (*Xqml) Partial

func (x *Xqml) Partial(b bool)

Partial allow to call ParseXml multiple times and return multiple XML files

func (*Xqml) Root

func (x *Xqml) Root(s string)

Root allows to set default element tag name in <root>...</root>. It used only with WriteXml(value).

func (*Xqml) WriteXml

func (x *Xqml) WriteXml(writer io.Writer, value any) error

Jump to

Keyboard shortcuts

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