Documentation
¶
Overview ¶
Package xmllib is an XML and JSON processing and comparison library
Index ¶
- func Convert(r io.Reader) (*bytes.Buffer, error)
- func ConvertXML(r io.Reader, cfg CfgType) (*bytes.Buffer, error)
- func Exists(name string) bool
- func Fopen(fn string, mode string) (file *os.File, err error)
- func KeysFromMap(a interface{}) (keys []string)
- func SVar(v interface{}) string
- func SVarI(v interface{}) string
- type AttrToValueType
- type CfgType
- type Decoder
- func (dec *Decoder) Decode(root *Node) error
- func (dec *Decoder) DecodeWithCustomPrefixes(root *Node, contentPrefix string, attributePrefix string) error
- func (dec *Decoder) SetAttributePrefix(prefix string) *Decoder
- func (dec *Decoder) SetContentPrefix(prefix string) *Decoder
- func (dec *Decoder) SetCustomPrefixes(att, cont string) *Decoder
- type Element
- type Encoder
- func (enc *Encoder) CustomPrefixesOption(contentPrefix string, attributePrefix string) *Encoder
- func (enc *Encoder) Encode(root *Node) error
- func (enc *Encoder) IndentOption(s string) *Encoder
- func (enc *Encoder) OutputFormatOption(s string) *Encoder
- func (enc *Encoder) SetAttributePrefix(prefix string)
- func (enc *Encoder) SetContentPrefix(prefix string)
- type NoSortType
- type Node
- type NodeList
- type NodeType
- type ValueToAttrType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertXML ¶
Convert converts the given XML document to JSON
func KeysFromMap ¶
func KeysFromMap(a interface{}) (keys []string)
OK test+ KeysFromMap returns an array of keys from a map.
Types ¶
type AttrToValueType ¶
type CfgType ¶
type CfgType struct { AttrsToValue []AttrToValueType `json:"AttrsToValue"` ValueToAttr []ValueToAttrType `json:"ValueToAttr"` NoSort []NoSortType `json:"NoSort"` // contains filtered or unexported fields }
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder reads and decodes XML objects from an input stream.
func NewDecoder ¶
NewDecoder returns a new decoder that reads from r.
func (*Decoder) DecodeWithCustomPrefixes ¶
func (dec *Decoder) DecodeWithCustomPrefixes(root *Node, contentPrefix string, attributePrefix string) error
xyzzy - deptricate this
func (*Decoder) SetAttributePrefix ¶
func (*Decoder) SetContentPrefix ¶
func (*Decoder) SetCustomPrefixes ¶
type Encoder ¶
type Encoder struct { Config CfgType // contains filtered or unexported fields }
An Encoder writes JSON objects to an output stream.
func NewEncoder ¶
NewEncoder returns a new encoder that writes to w.
func (*Encoder) CustomPrefixesOption ¶
func (*Encoder) IndentOption ¶
func (*Encoder) OutputFormatOption ¶
func (*Encoder) SetAttributePrefix ¶
func (*Encoder) SetContentPrefix ¶
type NoSortType ¶
type NoSortType struct {
TagName string `json:"TagName"`
}
type Node ¶
Node is a data element on a tree
func ReadXMLAsNode ¶
PJS - ReadXMLAsNode reads a source of XML and returns the Node tree
func (*Node) HasChildren ¶
HasChildren returns whether it is a complex type (has children)
type ValueToAttrType ¶
Click to show internal directories.
Click to hide internal directories.