Documentation
¶
Index ¶
- Constants
- func Stringify(v any) string
- type Xqml
- func (x *Xqml) Attributes(b bool)
- func (x *Xqml) Decoder(e *xml.Decoder)
- func (x *Xqml) Element(s string)
- func (x *Xqml) Encoder(e *xml.Encoder)
- func (x *Xqml) ForceList(s ...string)
- func (x *Xqml) Html(b bool)
- func (x *Xqml) Indent(s string)
- func (x *Xqml) Namespace(b bool)
- func (x *Xqml) ParseXml(reader io.Reader, cast bool) (map[string]any, error)
- func (x *Xqml) Partial(b bool)
- func (x *Xqml) Root(s string)
- func (x *Xqml) WriteXml(writer io.Writer, value any) error
Constants ¶
const ( DefaultRootTag = "root" DefaultElementTag = "element" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Xqml ¶
type Xqml struct {
// contains filtered or unexported fields
}
func (*Xqml) Attributes ¶ added in v0.0.2
Attributes allows to keep attributes. Default is to keep attributes, use Attributes(false) to remove them.
func (*Xqml) Decoder ¶
Decoder allows to set a customer xml decoder. Default decoder has Strict = true and Entity = xml.HTMLEntity.
func (*Xqml) Element ¶
Element allows to set default element tag name in <root><element>...</element></root>. It used only with WriteXml([]value).
func (*Xqml) ForceList ¶
ForceList allows to ensure some elements are parsed as slice, even when only one element is present.
func (*Xqml) Html ¶ added in v0.0.2
Html allows to manage HTML content, by auto-closing known HTML tags. Default is to not manage HTML content.
func (*Xqml) Namespace ¶
Namespace allows to keep namespaces. Default is to keep namespaces, use Namespace(false) to remove them.