Overview

PACKAGE

package libxml
import "bitbucket.org/ww/libxml"

Go bindings for libxml and libxslt.

At this stage they are very minimal and incomplete, basically
sufficient to load and apply an XSL transform which is what I need
them for. Contributions very welcome.


CONSTANTS

const XML_PARSE_COMPACT = C.XML_PARSE_COMPACT /* compact small text nodes; no modification of
the tree allowed afterwards (will possibly
crash if you try to modify the tree) */


const XML_PARSE_DTDATTR = C.XML_PARSE_DTDATTR /* default DTD attributes */


const XML_PARSE_DTDLOAD = C.XML_PARSE_DTDLOAD /* load the external subset */


const XML_PARSE_DTDVALID = C.XML_PARSE_DTDVALID /* validate with the DTD */


const XML_PARSE_HUGE = C.XML_PARSE_HUGE /* relax any hardcoded limit from the parser */


const XML_PARSE_NOBASEFIX = C.XML_PARSE_NOBASEFIX /* do not fixup XINCLUDE xml:base uris */


const XML_PARSE_NOBLANKS = C.XML_PARSE_NOBLANKS /* remove blank nodes */


const XML_PARSE_NOCDATA = C.XML_PARSE_NOCDATA /* merge CDATA as text nodes */


const XML_PARSE_NODICT = C.XML_PARSE_NODICT /* Do not reuse the context dictionnary */


const XML_PARSE_NOENT = C.XML_PARSE_NOENT /* substitute entities */


const XML_PARSE_NOERROR = C.XML_PARSE_NOERROR /* suppress error reports */


const XML_PARSE_NONET = C.XML_PARSE_NONET /* Forbid network access */


const XML_PARSE_NOWARNING = C.XML_PARSE_NOWARNING /* suppress warning reports */


const XML_PARSE_NOXINCNODE = C.XML_PARSE_NOXINCNODE /* do not generate XINCLUDE START/END nodes */


const XML_PARSE_NSCLEAN = C.XML_PARSE_NSCLEAN /* remove redundant namespaces declarations */


const XML_PARSE_OLD10 = C.XML_PARSE_OLD10 /* parse using XML-1.0 before update 5 */


const XML_PARSE_OLDSAX = C.XML_PARSE_OLDSAX /* parse using SAX2 interface from before 2.7.0 */


const XML_PARSE_PEDANTIC = C.XML_PARSE_PEDANTIC /* pedantic error reporting */


const XML_PARSE_RECOVER = C.XML_PARSE_RECOVER /* recover on errors */


const XML_PARSE_SAX1 = C.XML_PARSE_SAX1 /* use the SAX1 interface internally */


const XML_PARSE_XINCLUDE = C.XML_PARSE_XINCLUDE /* Implement XInclude substitition  */


const XSLT_PARSE_OPTIONS = C.XSLT_PARSE_OPTIONS /* The set of options to pass to an xmlReadxxx when loading files for XSLT consumption. */



TYPES

type Doc struct {
    // contains unexported fields
}

func Parse(xml, url string, options int) (doc *Doc, err os.Error)
parse an xml document from memory, with the provided string and
the given options.

func ParseFile(file string, options int) (doc *Doc, err os.Error)

func ParseReader(reader io.Reader, url string, options int) (doc *Doc, err os.Error)

func (doc *Doc) Free()

func (doc *Doc) String() (s string)

type Style struct {
    // contains unexported fields
}

func ParseStyle(doc *Doc) (style *Style, err os.Error)
Steals the reference to doc - freeing the resulting style
will free the document. If the stylesheet is invalid and
this call fails, the doc will be freed.

func (style *Style) Apply(doc *Doc) (res *Doc, err os.Error)

func (style *Style) Free()

func (style *Style) String() string