golibxml

package module
v0.0.0-...-90c340a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2019 License: MIT Imports: 2 Imported by: 7 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

golibxml

Build Status

golibxml is a simple wrapper for libxml. The goal is to avoid any extra magic so that a more friendly library can be written to sit on top of this one.

libxml/tree

54.43% (86/158)

libxml/parser

33.33% (24/72)

libxml/htmltree

50% (9/18)

libxml/htmlparser

31.57% (12/38)

libxml/xpath

50% (21/42)

libxml/memory

26.31% (5/19)

libxml/xmlreader

17.44% (15/86)

Documentation

Overview

Package golibxml is a simple wrapper for libxml2.

Index

Constants

View Source
const (
	HTML_PARSE_RECOVER   HTMLParserOption = C.HTML_PARSE_RECOVER   //: Relaxed parsing
	HTML_PARSE_NODEFDTD                   = C.HTML_PARSE_NODEFDTD  //: do not default a doctype if not found
	HTML_PARSE_NOERROR                    = C.HTML_PARSE_NOERROR   //: suppress error reports
	HTML_PARSE_NOWARNING                  = C.HTML_PARSE_NOWARNING //: suppress warning reports
	HTML_PARSE_PEDANTIC                   = C.HTML_PARSE_PEDANTIC  //: pedantic error reporting
	HTML_PARSE_NOBLANKS                   = C.HTML_PARSE_NOBLANKS  //: remove blank nodes
	HTML_PARSE_NONET                      = C.HTML_PARSE_NONET     //: Forbid network access
	HTML_PARSE_NOIMPLIED                  = C.HTML_PARSE_NOIMPLIED //: Do not add implied html/body... elements
	HTML_PARSE_COMPACT                    = C.HTML_PARSE_COMPACT   //: compact small text nodes
)
View Source
const (
	XML_CHAR_ENCODING_ERROR     Encoding = -1 //: No char encoding detected
	XML_CHAR_ENCODING_NONE               = 0  //: No char encoding detected
	XML_CHAR_ENCODING_UTF8               = 1  //: UTF-8
	XML_CHAR_ENCODING_UTF16LE            = 2  //: UTF-16 little endian
	XML_CHAR_ENCODING_UTF16BE            = 3  //: UTF-16 big endian
	XML_CHAR_ENCODING_UCS4LE             = 4  //: UCS-4 little endian
	XML_CHAR_ENCODING_UCS4BE             = 5  //: UCS-4 big endian
	XML_CHAR_ENCODING_EBCDIC             = 6  //: EBCDIC uh!
	XML_CHAR_ENCODING_UCS4_2143          = 7  //: UCS-4 unusual ordering
	XML_CHAR_ENCODING_UCS4_3412          = 8  //: UCS-4 unusual ordering
	XML_CHAR_ENCODING_UCS2               = 9  //: UCS-2
	XML_CHAR_ENCODING_8859_1             = 10 //: ISO-8859-1 ISO Latin 1
	XML_CHAR_ENCODING_8859_2             = 11 //: ISO-8859-2 ISO Latin 2
	XML_CHAR_ENCODING_8859_3             = 12 //: ISO-8859-3
	XML_CHAR_ENCODING_8859_4             = 13 //: ISO-8859-4
	XML_CHAR_ENCODING_8859_5             = 14 //: ISO-8859-5
	XML_CHAR_ENCODING_8859_6             = 15 //: ISO-8859-6
	XML_CHAR_ENCODING_8859_7             = 16 //: ISO-8859-7
	XML_CHAR_ENCODING_8859_8             = 17 //: ISO-8859-8
	XML_CHAR_ENCODING_8859_9             = 18 //: ISO-8859-9
	XML_CHAR_ENCODING_2022_JP            = 19 //: ISO-2022-JP
	XML_CHAR_ENCODING_SHIFT_JIS          = 20 //: Shift_JIS
	XML_CHAR_ENCODING_EUC_JP             = 21 //: EUC-JP
	XML_CHAR_ENCODING_ASCII              = 22 //: pure ASCII
)
View Source
const (
	XML_PARSE_RECOVER    ParserOption = C.XML_PARSE_RECOVER    //: recover on errors
	XML_PARSE_NOENT                   = C.XML_PARSE_NOENT      //: substitute entities
	XML_PARSE_DTDLOAD                 = C.XML_PARSE_DTDLOAD    //: load the external subset
	XML_PARSE_DTDATTR                 = C.XML_PARSE_DTDATTR    //: default DTD attributes
	XML_PARSE_DTDVALID                = C.XML_PARSE_DTDVALID   //: validate with the DTD
	XML_PARSE_NOERROR                 = C.XML_PARSE_NOERROR    //: suppress error reports
	XML_PARSE_NOWARNING               = C.XML_PARSE_NOWARNING  //: suppress warning reports
	XML_PARSE_PEDANTIC                = C.XML_PARSE_PEDANTIC   //: pedantic error reporting
	XML_PARSE_NOBLANKS                = C.XML_PARSE_NOBLANKS   //: remove blank nodes
	XML_PARSE_SAX1                    = C.XML_PARSE_SAX1       //: use the SAX1 interface internally
	XML_PARSE_XINCLUDE                = C.XML_PARSE_XINCLUDE   //: Implement XInclude substitition
	XML_PARSE_NONET                   = C.XML_PARSE_NONET      //: Forbid network access
	XML_PARSE_NODICT                  = C.XML_PARSE_NODICT     //: Do not reuse the context dictionnary
	XML_PARSE_NSCLEAN                 = C.XML_PARSE_NSCLEAN    //: remove redundant namespaces declarations
	XML_PARSE_NOCDATA                 = C.XML_PARSE_NOCDATA    //: merge CDATA as text nodes
	XML_PARSE_NOXINCNODE              = C.XML_PARSE_NOXINCNODE //: do not generate XINCLUDE START/END nodes
	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)
	XML_PARSE_OLD10                   = C.XML_PARSE_OLD10      //: parse using XML-1.0 before update 5
	XML_PARSE_NOBASEFIX               = C.XML_PARSE_NOBASEFIX  //: do not fixup XINCLUDE xml:base uris
	XML_PARSE_HUGE                    = C.XML_PARSE_HUGE       //: relax any hardcoded limit from the parser
	XML_PARSE_OLDSAX                  = C.XML_PARSE_OLDSAX     //: parse using SAX2 interface from before 2.7.0
)
View Source
const (
	XML_READER_TYPE_NONE                   ReaderType = C.XML_READER_TYPE_NONE
	XML_READER_TYPE_ELEMENT                           = C.XML_READER_TYPE_ELEMENT
	XML_READER_TYPE_ATTRIBUTE                         = C.XML_READER_TYPE_ATTRIBUTE
	XML_READER_TYPE_TEXT                              = C.XML_READER_TYPE_TEXT
	XML_READER_TYPE_CDATA                             = C.XML_READER_TYPE_CDATA
	XML_READER_TYPE_ENTITY_REFERENCE                  = C.XML_READER_TYPE_ENTITY_REFERENCE
	XML_READER_TYPE_ENTITY                            = C.XML_READER_TYPE_ENTITY
	XML_READER_TYPE_PROCESSING_INSTRUCTION            = C.XML_READER_TYPE_PROCESSING_INSTRUCTION
	XML_READER_TYPE_COMMENT                           = C.XML_READER_TYPE_COMMENT
	XML_READER_TYPE_DOCUMENT                          = C.XML_READER_TYPE_DOCUMENT
	XML_READER_TYPE_DOCUMENT_TYPE                     = C.XML_READER_TYPE_DOCUMENT_TYPE
	XML_READER_TYPE_DOCUMENT_FRAGMENT                 = C.XML_READER_TYPE_DOCUMENT_FRAGMENT
	XML_READER_TYPE_NOTATION                          = C.XML_READER_TYPE_NOTATION
	XML_READER_TYPE_WHITESPACE                        = C.XML_READER_TYPE_WHITESPACE
	XML_READER_TYPE_SIGNIFICANT_WHITESPACE            = C.XML_READER_TYPE_SIGNIFICANT_WHITESPACE
	XML_READER_TYPE_END_ELEMENT                       = C.XML_READER_TYPE_END_ELEMENT
	XML_READER_TYPE_END_ENTITY                        = C.XML_READER_TYPE_END_ENTITY
	XML_READER_TYPE_XML_DECLARATION                   = C.XML_READER_TYPE_XML_DECLARATION
)
View Source
const (
	XML_BUFFER_ALLOC_DOUBLEIT  AllocationScheme = 1 //: double each time one need to grow
	XML_BUFFER_ALLOC_EXACT                      = 2 //: grow only to the minimal size
	XML_BUFFER_ALLOC_IMMUTABLE                  = 3 //: immutable buffer
	XML_BUFFER_ALLOC_IO                         = 4 //: special allocation scheme used for I/O
)
View Source
const (
	XML_ELEMENT_NODE       ElementType = 1
	XML_ATTRIBUTE_NODE                 = 2
	XML_TEXT_NODE                      = 3
	XML_CDATA_SECTION_NODE             = 4
	XML_ENTITY_REF_NODE                = 5
	XML_ENTITY_NODE                    = 6
	XML_PI_NODE                        = 7
	XML_COMMENT_NODE                   = 8
	XML_DOCUMENT_NODE                  = 9
	XML_DOCUMENT_TYPE_NODE             = 10
	XML_DOCUMENT_FRAG_NODE             = 11
	XML_NOTATION_NODE                  = 12
	XML_HTML_DOCUMENT_NODE             = 13
	XML_DTD_NODE                       = 14
	XML_ELEMENT_DECL                   = 15
	XML_ATTRIBUTE_DECL                 = 16
	XML_ENTITY_DECL                    = 17
	XML_NAMESPACE_DECL                 = 18
	XML_XINCLUDE_START                 = 19
	XML_XINCLUDE_END                   = 20
	XML_DOCB_DOCUMENT_NODE             = 21
)
View Source
const (
	XPATH_UNDEFINED   XpathObjectType = 0
	XPATH_NODESET                     = 1
	XPATH_BOOLEAN                     = 2
	XPATH_NUMBER                      = 3
	XPATH_STRING                      = 4
	XPATH_POINT                       = 5
	XPATH_RANGE                       = 6
	XPATH_LOCATIONSET                 = 7
	XPATH_USERS                       = 8
	XPATH_XSLT_TREE                   = 9 //: An XSLT value tree, non modifiable
)

Variables

This section is empty.

Functions

func CleanupMemory

func CleanupMemory()

xmlCleanupMemory

func CleanupParser

func CleanupParser()

xmlCleanupParser

func GetFeaturesList

func GetFeaturesList() []string

xmlGetFeaturesList

func InitMemory

func InitMemory()

xmlInitMemory

func IsBooleanAttr

func IsBooleanAttr(name string) bool

htmlIsBooleanAttr

func MemBlocks

func MemBlocks() int

xmlMemBlocks

func MemUsed

func MemUsed() int

xmlMemUsed

func MemoryDump

func MemoryDump()

xmlMemoryDump

func RemoveAttribute

func RemoveAttribute(attr *Attribute) int

xmlRemoveProp

func SetAllocationScheme

func SetAllocationScheme(scheme AllocationScheme)

xmlSetBufferAllocationScheme

func SetCompressionLevel

func SetCompressionLevel(level int)

xmlSetCompressMode

func SubstituteEntitiesDefault

func SubstituteEntitiesDefault(val int) int

xmlSubstituteEntitiesDefault

func ValidateNCName

func ValidateNCName(value string, space int) int

xmlValidateNCName

func ValidateNMToken

func ValidateNMToken(value string, space int) int

xmlValidateNMToken

func ValidateName

func ValidateName(value string, space int) int

xmlValidateName

func ValidateQName

func ValidateQName(value string, space int) int

xmlValidateQName

func XpathIsNaN

func XpathIsNaN(val float32) int

xmlXPathIsNaN

Types

type AllocationScheme

type AllocationScheme int

type Attribute

type Attribute struct {
	Ptr C.xmlAttrPtr
}

func (*Attribute) Children

func (attr *Attribute) Children() *Node

func (*Attribute) Copy

func (attr *Attribute) Copy(target *Node) *Attribute

xmlCopyProp

func (*Attribute) CopyList

func (attr *Attribute) CopyList(target *Node) *Attribute

xmlCopyPropList

func (*Attribute) Free

func (attr *Attribute) Free()

xmlFreeProp

func (*Attribute) FreeList

func (attr *Attribute) FreeList()

xmlFreePropList

func (*Attribute) Name

func (attr *Attribute) Name() string

func (*Attribute) Namespace

func (attr *Attribute) Namespace() *Namespace

func (*Attribute) Next

func (attr *Attribute) Next() *Attribute

func (*Attribute) Type

func (attr *Attribute) Type() ElementType

type Buffer

type Buffer struct {
	Ptr C.xmlBufferPtr
}

func NewBuffer

func NewBuffer() *Buffer

xmlBufferCreate

func NewBufferSize

func NewBufferSize(size int) *Buffer

xmlBufferCreateSize

func (*Buffer) Add

func (buffer *Buffer) Add(str []byte) int

xmlBufferAdd

func (*Buffer) AddHead

func (buffer *Buffer) AddHead(str []byte) int

xmlBufferAddHead

func (*Buffer) Cat

func (buffer *Buffer) Cat(str string) int

xmlBufferCat/xmlBufferCCat

func (*Buffer) Content

func (buffer *Buffer) Content() string

xmlBufferContent

func (*Buffer) Empty

func (buffer *Buffer) Empty()

xmlBufferEmpty

func (*Buffer) Free

func (buffer *Buffer) Free()

xmlBufferFree

func (*Buffer) Grow

func (buffer *Buffer) Grow(length int) int

xmlBufferGrow

func (*Buffer) Length

func (buffer *Buffer) Length() int

xmlBufferLength

func (*Buffer) Resize

func (buffer *Buffer) Resize(size int) int

xmlBufferResize

func (*Buffer) SetAllocationScheme

func (buffer *Buffer) SetAllocationScheme(scheme AllocationScheme)

xmlBufferSetAllocationScheme

func (*Buffer) Shrink

func (buffer *Buffer) Shrink(length int) int

xmlBufferShrink

func (*Buffer) WriteChar

func (buffer *Buffer) WriteChar(str string)

xmlBufferWriteChar/xmlBufferWriteCHAR

type Document

type Document struct {
	*Node
	Ptr C.xmlDocPtr
}

func NewDoc

func NewDoc(version string) *Document

xmlNewDoc

func ParseDoc

func ParseDoc(cur string) *Document

xmlParseDoc

func ParseEntity

func ParseEntity(filename string) *Document

xmlParseEntity

func ParseFile

func ParseFile(filename string) *Document

xmlParseFile

func ParseMemory

func ParseMemory(buffer []byte) *Document

xmlParseMemory

func ReadDoc

func ReadDoc(input string, url string, encoding string, options ParserOption) *Document

xmlReadDoc

func ReadFile

func ReadFile(filename string, encoding string, options ParserOption) *Document

xmlReadFile

func ReadMemory

func ReadMemory(buffer []byte, url string, encoding string, options ParserOption) *Document

xmlReadMemory

func RecoverDoc

func RecoverDoc(cur string) *Document

xmlRecoverDoc

func RecoverFile

func RecoverFile(filename string) *Document

xmlRecoverFile

func RecoverMemory

func RecoverMemory(buffer []byte) *Document

xmlRecoverMemory

func (*Document) Copy

func (doc *Document) Copy(recursive int) *Document

xmlCopyDoc

func (*Document) Free

func (doc *Document) Free()

xmlFreeDoc

func (*Document) NewComment

func (doc *Document) NewComment(content string) *Node

xmlNewDocComment

func (*Document) NewDtd

func (doc *Document) NewDtd(name string, ExternalID string, SystemID string) *Dtd

xmlNewDtd

func (*Document) NewFragment

func (doc *Document) NewFragment() *Node

xmlNewDocFragment

func (*Document) NewNode

func (doc *Document) NewNode(ns *Namespace, name string, content string) *Node

xmlNewDocNode

func (*Document) NewProp

func (doc *Document) NewProp(name string, value string) *Attribute

xmlNewDocProp

func (*Document) NewRawNode

func (doc *Document) NewRawNode(ns *Namespace, name string, content string) *Node

xmlNewDocRawNode

func (*Document) NewText

func (doc *Document) NewText(content string) *TextNode

xmlNewDocText

func (*Document) NodeDump

func (doc *Document) NodeDump(buf *Buffer, cur *Node, level int, format int) int

xmlNodeDump

func (*Document) OrderDocElems

func (doc *Document) OrderDocElems() int

xmlXPathOrderDocElems

func (*Document) Root

func (doc *Document) Root() *Node

xmlDocGetRootElement

func (*Document) SaveFile

func (doc *Document) SaveFile(filename string) int

xmlSaveFile

func (*Document) SaveFileEnc

func (doc *Document) SaveFileEnc(filename string, encoding string) int

xmlSaveFileEnc

func (*Document) SaveFormatFile

func (doc *Document) SaveFormatFile(filename string, format int) int

xmlSaveFormatFile

func (*Document) SaveFormatFileEnc

func (doc *Document) SaveFormatFileEnc(filename string, encoding string, format int) int

xmlSaveFormatFileEnc

func (*Document) SetCompressionLevel

func (doc *Document) SetCompressionLevel(level int)

xmlSetDocCompressMode

func (*Document) SetRoot

func (doc *Document) SetRoot(root *Node) *Node

xmlDocSetRootElement

func (*Document) String

func (doc *Document) String() string

type Dtd

type Dtd struct {
	Ptr C.xmlDtdPtr
}

func ParseDTD

func ParseDTD(ExternalID string, SystemID string) *Dtd

xmlParseDTD

func (*Dtd) Copy

func (dtd *Dtd) Copy() *Dtd

xmlCopyDtd

func (*Dtd) Free

func (dtd *Dtd) Free()

xmlFreeDtd

type ElemDesc

type ElemDesc struct {
	Ptr C.htmlElemDescPtr
}

func TagLookup

func TagLookup(tag string) *ElemDesc

htmlTagLookup

type ElementType

type ElementType int

func (ElementType) GoString

func (elem ElementType) GoString() string

func (ElementType) String

func (elem ElementType) String() string

type Encoding

type Encoding int

func DetectCharEncoding

func DetectCharEncoding(buffer []byte) Encoding

xmlDetectCharEncoding

type HTMLDocument

type HTMLDocument struct {
	*Document
	*HTMLNode
	Ptr C.htmlDocPtr
}

func NewHTMLDoc

func NewHTMLDoc(uri string, external_id string) *HTMLDocument

htmlNewDoc

func NewHTMLDocNoDtd

func NewHTMLDocNoDtd() *HTMLDocument

htmlNewDocNoDtD

func ParseHTMLDoc

func ParseHTMLDoc(cur string, encoding string) *HTMLDocument

htmlParseDoc

func ParseHTMLFile

func ParseHTMLFile(filename string, encoding string) *HTMLDocument

htmlParseFile

func ReadHTMLDoc

func ReadHTMLDoc(cur string, url string, encoding string, options HTMLParserOption) *HTMLDocument

htmlReadDoc

func ReadHTMLFile

func ReadHTMLFile(filename string, encoding string, options HTMLParserOption) *HTMLDocument

htmlReadFile

func ReadHTMLMemory

func ReadHTMLMemory(buffer []byte, url string, encoding string, options HTMLParserOption) *HTMLDocument

htmlReadMemory

func (*HTMLDocument) AutoCloseTag

func (doc *HTMLDocument) AutoCloseTag(name string, node *Node) bool

htmlAutoCloseTag

func (*HTMLDocument) GetMetaEncoding

func (doc *HTMLDocument) GetMetaEncoding() string

htmlGetMetaEncoding

func (*HTMLDocument) NodeDump

func (doc *HTMLDocument) NodeDump(buf *Buffer, cur *HTMLNode) int

htmlNodeDump

func (*HTMLDocument) SaveFile

func (doc *HTMLDocument) SaveFile(filename string) int

htmlSaveFile

func (*HTMLDocument) SaveFileEnc

func (doc *HTMLDocument) SaveFileEnc(filename string, encoding string) int

htmlSaveFileEnc

func (*HTMLDocument) SaveFileFormat

func (doc *HTMLDocument) SaveFileFormat(filename string, encoding string, format int) int

htmlSaveFileFormat

func (*HTMLDocument) SetMetaEncoding

func (doc *HTMLDocument) SetMetaEncoding(encoding string) int

htmlSetMetaEncoding

func (*HTMLDocument) String

func (doc *HTMLDocument) String() string

type HTMLNode

type HTMLNode struct {
	*Node
	Ptr C.htmlNodePtr
}

type HTMLParser

type HTMLParser struct {
	Ptr C.htmlParserCtxtPtr
}

func NewHTMLParserCtxt

func NewHTMLParserCtxt() *HTMLParser

htmlNewParserCtxt

func (*HTMLParser) Free

func (p *HTMLParser) Free()

htmlFreeParserCtxt

func (*HTMLParser) ReadDoc

func (p *HTMLParser) ReadDoc(input string, url string, encoding string, options ParserOption) *HTMLDocument

htmlCtxtReadDoc

func (*HTMLParser) Reset

func (p *HTMLParser) Reset()

htmlCtxtReset

func (*HTMLParser) UseOptions

func (p *HTMLParser) UseOptions(options HTMLParserOption) int

htmlCtxtUseOptions

type HTMLParserOption

type HTMLParserOption int

type Namespace

type Namespace struct {
	Ptr C.xmlNsPtr
}

func (*Namespace) Copy

func (ns *Namespace) Copy(extended int) *Namespace

xmlCopyNamespace

func (*Namespace) CopyList

func (ns *Namespace) CopyList(extended int) *Namespace

xmlCopyNamespaceList

func (*Namespace) Free

func (ns *Namespace) Free()

xmlFreeNs

func (*Namespace) FreeList

func (ns *Namespace) FreeList()

xmlFreeNsList

func (*Namespace) Href

func (ns *Namespace) Href() string

func (*Namespace) Prefix

func (ns *Namespace) Prefix() string

type Node

type Node struct {
	Ptr C.xmlNodePtr
}

func NewComment

func NewComment(content string) *Node

xmlNewComment

func NewNode

func NewNode(ns *Namespace, name string) *Node

xmlNewNode

func (*Node) AddChild

func (parent *Node) AddChild(cur *Node) *Node

xmlAddChild

func (*Node) AddChildList

func (parent *Node) AddChildList(cur Node) *Node

xmlAddChildList

func (*Node) AddContent

func (node *Node) AddContent(content string)

xmlNodeAddContent

func (*Node) AddNextSibling

func (cur *Node) AddNextSibling(elem Node) *Node

xmlAddNextSibling

func (*Node) AddPrevSibling

func (cur *Node) AddPrevSibling(elem Node) *Node

xmlAddPrevSibling

func (*Node) AddSibling

func (cur *Node) AddSibling(elem Node) *Node

xmlAddSibling

func (*Node) Attributes

func (node *Node) Attributes() *Attribute

func (*Node) ChildCount

func (node *Node) ChildCount() int

xmlChildElementCount

func (*Node) Children

func (node *Node) Children() *Node

func (*Node) Copy

func (node *Node) Copy(extended int) *Node

xmlCopyNode

func (*Node) CopyList

func (node *Node) CopyList() *Node

xmlCopyNodeList

func (*Node) Document

func (node *Node) Document() *Document

func (*Node) FirstChild

func (node *Node) FirstChild() *Node

xmlFirstElementChild

func (*Node) Free

func (node *Node) Free()

xmlFreeNode

func (*Node) FreeList

func (node *Node) FreeList()

xmlFreeNodeList

func (*Node) GetContent

func (node *Node) GetContent() string

xmlNodeGetContent

func (*Node) LastChild

func (node *Node) LastChild() *Node

xmlGetLastChild

func (*Node) LastElementChild

func (node *Node) LastElementChild() *Node

xmlLastElementChild

func (*Node) ListGetString

func (node *Node) ListGetString(inLine bool) string

xmlNodeListGetString

func (*Node) Name

func (node *Node) Name() string

func (*Node) Namespace

func (node *Node) Namespace() *Namespace

func (*Node) NewAttribute

func (node *Node) NewAttribute(name string, value string) *Attribute

xmlNewProp

func (*Node) NewChild

func (node *Node) NewChild(ns *Namespace, name string, content string) *Node

xmlNewChild

func (*Node) NewNs

func (node *Node) NewNs(href string, prefix string) *Namespace

xmlNewNs

func (*Node) NewTextChild

func (node *Node) NewTextChild(ns *Namespace, name string, content string) *TextNode

xmlNewTextChild

func (*Node) Next

func (node *Node) Next() *Node

func (*Node) NextSibling

func (node *Node) NextSibling() *Node

xmlNextElementSibling

func (*Node) Path

func (node *Node) Path() string

xmlGetNodePath

func (*Node) PreviousSibling

func (node *Node) PreviousSibling() *Node

xmlPreviousElementSibling

func (*Node) Replace

func (old *Node) Replace(cur *Node) *Node

xmlReplaceNode

func (*Node) SetAttribute

func (node *Node) SetAttribute(name string, value string) *Attribute

xmlSetProp

func (*Node) SetContent

func (node *Node) SetContent(content string)

xmlNodeSetContent

func (*Node) SetName

func (node *Node) SetName(name string)

xmlNodeSetName

func (*Node) String

func (node *Node) String() string

func (*Node) Type

func (node *Node) Type() ElementType
func (node *Node) Unlink()

xmlUnlinkNode

func (*Node) UnsetNsProp

func (node *Node) UnsetNsProp(ns *Namespace, name string) int

xmlUnsetNsProp

func (*Node) UnsetProp

func (node *Node) UnsetProp(name string) int

xmlUnsetProp

type NodeSet

type NodeSet struct {
	Ptr C.xmlNodeSetPtr
}

func NodeSetCreate

func NodeSetCreate(node *Node) *NodeSet

xmlXPathNodeSetCreate

func (*NodeSet) Free

func (nodeset *NodeSet) Free()

xmlXPathFreeNodeSet

type Parser

type Parser struct {
	Ptr C.xmlParserCtxtPtr
}

func CreateDocParser

func CreateDocParser(cur string) *Parser

xmlCreateDocParserCtxt

func NewParser

func NewParser() *Parser

xmlNewParserCtxt

func (*Parser) ByteConsumed

func (p *Parser) ByteConsumed() int

xmlByteConsumed

func (*Parser) Clear

func (p *Parser) Clear()

xmlClearParserCtxt

func (*Parser) Free

func (p *Parser) Free()

xmlFreeParserCtxt

func (*Parser) MyDoc

func (p *Parser) MyDoc() *Document

func (*Parser) Parse

func (p *Parser) Parse() int

xmlParseDocument

func (*Parser) ReadDoc

func (p *Parser) ReadDoc(input string, url string, encoding string, options ParserOption) *Document

xmlCtxtReadDoc

func (*Parser) Reset

func (p *Parser) Reset()

xmlCtxtReset

func (*Parser) Stop

func (p *Parser) Stop()

xmlStopParser

func (*Parser) UseOptions

func (p *Parser) UseOptions(options ParserOption) int

xmlCtxtUseOptions

type ParserOption

type ParserOption int

type ReaderType

type ReaderType int

xmlReaderTypes

func (ReaderType) String

func (t ReaderType) String() string

type TextNode

type TextNode struct {
	*Node
}

func NewText

func NewText(content string) *TextNode

xmlNewText

func (*TextNode) Concat

func (node *TextNode) Concat(content string) int

xmlTextConcat

func (*TextNode) Merge

func (first *TextNode) Merge(second *Node) *Node

xmlTextMerge

type TextReader

type TextReader struct {
	Ptr C.xmlTextReaderPtr
	// contains filtered or unexported fields
}

func ReaderForMemory

func ReaderForMemory(buffer string, url, encoding string, options ParserOption) *TextReader

xmlReaderForMemory

func (*TextReader) Depth

func (r *TextReader) Depth() int

xmlTextReaderDepth

func (*TextReader) Free

func (r *TextReader) Free()

xmlFreeTextReader

func (*TextReader) GetAttribute

func (r *TextReader) GetAttribute(name string) *string

xmlTextReaderGetAttribute

func (*TextReader) LocalName

func (r *TextReader) LocalName() string

xmlTextReaderConstLocalName

func (*TextReader) MoveToFirstAttribute

func (r *TextReader) MoveToFirstAttribute() int

xmlTextReaderMoveToFirstAttribute

func (*TextReader) MoveToNextAttribute

func (r *TextReader) MoveToNextAttribute() int

xmlTextReaderMoveToNextAttribute

func (*TextReader) Name

func (r *TextReader) Name() string

xmlTextReaderConstName

func (*TextReader) NamespaceUri

func (r *TextReader) NamespaceUri() string

xmlTextReaderConstNamespaceUri

func (*TextReader) Next

func (r *TextReader) Next() int

xmlTextReaderNext

func (*TextReader) NodeType

func (r *TextReader) NodeType() ReaderType

xmlTextReaderNodeType

func (*TextReader) Prefix

func (r *TextReader) Prefix() string

xmlTextReaderConstPrefix

func (*TextReader) Read

func (r *TextReader) Read() int

xmlTextReaderRead

func (*TextReader) ReadString

func (r *TextReader) ReadString() string

xmlTextReaderReadString

func (*TextReader) Value

func (r *TextReader) Value() string

xmlTextReaderValue

type XPath

type XPath struct {
	Ptr C.xmlXPathCompExprPtr
}

func CompileXPath

func CompileXPath(str string) *XPath

xmlXPathCompile

func (*XPath) Free

func (xpath *XPath) Free()

xmlXPathFreeCompExpr

type XPathContext

type XPathContext struct {
	Ptr C.xmlXPathContextPtr
}

func NewXPathContext

func NewXPathContext(doc *Document) *XPathContext

xmlXPathNewContext

func (*XPathContext) Compile

func (ctx *XPathContext) Compile(str string) *XPath

xmlXPathCtxtCompile

func (*XPathContext) Eval

func (ctx *XPathContext) Eval(str string) *XPathObject

xmlXPathEval

func (*XPathContext) EvalExpression

func (ctx *XPathContext) EvalExpression(str string) *XPathObject

xmlXPathEvalExpression

func (*XPathContext) EvalPredicate

func (ctx *XPathContext) EvalPredicate(res *XPathObject) bool

xmlXPathEvalPredicate

func (*XPathContext) Free

func (ctx *XPathContext) Free()

xmlXPathFreeContext

type XPathObject

type XPathObject struct {
	Ptr C.xmlXPathObjectPtr
}

func (*XPathObject) CastToNumber

func (obj *XPathObject) CastToNumber() float32

xmlXPathCastToNumber

func (*XPathObject) ConvertBoolean

func (obj *XPathObject) ConvertBoolean() *XPathObject

xmlXPathConvertBoolean

func (*XPathObject) ConvertNumber

func (obj *XPathObject) ConvertNumber() *XPathObject

xmlXPathConvertNumber

func (*XPathObject) ConvertString

func (obj *XPathObject) ConvertString() *XPathObject

xmlXPathConvertString

func (*XPathObject) Copy

func (obj *XPathObject) Copy() *XPathObject

xmlXPathObjectCopy

func (*XPathObject) Free

func (obj *XPathObject) Free()

xmlXPathFreeObject

func (*XPathObject) FreeList

func (obj *XPathObject) FreeList()

xmlXPathFreeNodeSetList

func (*XPathObject) Results

func (obj *XPathObject) Results() chan *Node

func (*XPathObject) String

func (obj *XPathObject) String() string

xmlXPathCastToString

type XpathObjectType

type XpathObjectType int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址