Documentation ¶
Overview ¶
Package marshal contains functions for encoding structs as an XML token stream.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeXML ¶
func EncodeXML(w xmlstream.TokenWriter, v interface{}) error
EncodeXML writes the XML encoding of v to the stream.
See the documentation for xml.Marshal for details about the conversion of Go values to XML.
If the stream is an xmlstream.Flusher, EncodeXML calls Flush before returning.
func EncodeXMLElement ¶
func EncodeXMLElement(w xmlstream.TokenWriter, v interface{}, start xml.StartElement) error
EncodeXMLElement writes the XML encoding of v to the stream, using start as the outermost tag in the encoding.
See the documentation for xml.Marshal for details about the conversion of Go values to XML.
If the stream is an xmlstream.Flusher, EncodeXMLElement calls Flush before returning.
func TokenReader ¶ added in v0.17.0
func TokenReader(v interface{}) (xml.TokenReader, error)
TokenReader returns a reader for the XML encoding of v.
Types ¶
This section is empty.
Notes ¶
Bugs ¶
This package is very inefficient, see https://mellium.im/issue/38.