Documentation
¶
Index ¶
- Constants
- func Stringify(v any) string
- func ToJson(b []byte) (map[string]any, error)
- type Xqml
- func (x *Xqml) ParseXml(reader io.Reader, cast bool) (map[string]any, error)
- func (x *Xqml) SetReadAttributes(b bool)
- func (x *Xqml) SetReadDecoder(e *xml.Decoder)
- func (x *Xqml) SetReadForceList(s ...string)
- func (x *Xqml) SetReadHtml(b bool)
- func (x *Xqml) SetReadNamespaces(b bool)
- func (x *Xqml) SetReadPartials(b bool)
- func (x *Xqml) SetWriteElement(s string)
- func (x *Xqml) SetWriteEncoder(e *xml.Encoder)
- func (x *Xqml) SetWriteIndent(s string)
- func (x *Xqml) SetWriteRoot(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) SetReadAttributes ¶ added in v0.0.3
SetReadAttributes allows to keep attributes. Default is to keep attributes, use SetReadAttributes(false) to remove them.
func (*Xqml) SetReadDecoder ¶ added in v0.0.3
SetReadDecoder allows to set a customer xml decoder. Default decoder has Strict = true and Entity = xml.HTMLEntity.
func (*Xqml) SetReadForceList ¶ added in v0.0.3
SetReadForceList allows to ensure some elements are parsed as slice, even when only one element is present. Use "x" for element name at any path, or "r.x" path. Also supports multiple commma separated paths at once, like "a.b,a.c,d".
func (*Xqml) SetReadHtml ¶ added in v0.0.3
SetReadHtml allows to manage HTML content, by auto-closing known HTML tags. Default is to not manage HTML content.
func (*Xqml) SetReadNamespaces ¶ added in v0.0.5
SetReadNamespaces allows to keep namespaces. Default is to keep namespaces, use SetReadNamespaces(false) to remove them.
func (*Xqml) SetReadPartials ¶ added in v0.0.3
SetReadPartials allow to call ParseXml multiple times and return multiple XML files
func (*Xqml) SetWriteElement ¶ added in v0.0.3
SetWriteElement allows to set default element tag name in <root><element>...</element></root>. It used only with WriteXml([]value).
func (*Xqml) SetWriteEncoder ¶ added in v0.0.3
SetWriteEncoder allows to set a customer xml encoder.
func (*Xqml) SetWriteIndent ¶ added in v0.0.3
SetWriteIndent allows to set indent string. Use "" for compact write.
func (*Xqml) SetWriteRoot ¶ added in v0.0.3
SetWriteRoot allows to set default element tag name in <root>...</root>. It used only with WriteXml(value).