reader

package module
v0.0.0-...-b573913 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

* Theoretically this package ought to implement the xmlTextReader interface * found in "xmlreader.h". It allows one to walk through an XML document line by * line, with somewhat more information on the actual structure of the document. * Iteration will include both start and end tags in the order they appear, in * addition to all whitespace in the document.

Index

Constants

View Source
const (
	Reader_None                  = myXMLclib.Reader_None
	Reader_Element               = myXMLclib.Reader_Element
	Reader_Attribute             = myXMLclib.Reader_Attribute
	Reader_Text                  = myXMLclib.Reader_Text
	Reader_Cdata                 = myXMLclib.Reader_Cdata
	Reader_EntityReference       = myXMLclib.Reader_EntityReference
	Reader_Entity                = myXMLclib.Reader_Entity
	Reader_ProcessingInstruction = myXMLclib.Reader_ProcessingInstruction
	Reader_Comment               = myXMLclib.Reader_Comment
	Reader_Document              = myXMLclib.Reader_Document
	Reader_DocumentType          = myXMLclib.Reader_DocumentType
	Reader_DocumentFragment      = myXMLclib.Reader_DocumentFragment
	Reader_Notation              = myXMLclib.Reader_Notation
	Reader_Whitespace            = myXMLclib.Reader_Whitespace
	Reader_SignificantWhitespace = myXMLclib.Reader_SignificantWhitespace
	Reader_EndElement            = myXMLclib.Reader_EndElement
	Reader_EndEntity             = myXMLclib.Reader_EndEntity
	Reader_XmlDeclaration        = myXMLclib.Reader_XmlDeclaration
)

FIXME These names are bad

View Source
const (
	ParserLoadDTD       = myXMLclib.ParserLoadDTD
	ParserDefaultAttrs  = myXMLclib.ParserDefaultAttrs
	ParserValidate      = myXMLclib.ParserValidate
	ParserSubstEntities = myXMLclib.ParserSubstEntities
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TextReader

type TextReader interface {
	XMLtypes.PtrSource
	TextRead() int
	NodeType() myXMLclib.XMLReaderType
	Name() string
	Value() string
	AttributeCount() int
	Depth() int
	MoveToAttributeNo(int) error
	MoveToFirstAttribute() error
	MoveToNextAttribute() error
	MoveToElement() error
	CurrentNode() (XMLtypes.Node, error)
	SetParserProp(prop myXMLclib.XMLParserProperties, value int) error
	SetSchema(*XMLxsd.Schema) error
}

func NewTextReaderFromDoc

func NewTextReaderFromDoc(document XMLtypes.Document) (TextReader, error)

Creates a new text reader from an XML document.

type XMLTextReader

type XMLTextReader struct {
	// contains filtered or unexported fields
}

func (*XMLTextReader) AttributeCount

func (r *XMLTextReader) AttributeCount() int

func (*XMLTextReader) CurrentNode

func (r *XMLTextReader) CurrentNode() (XMLtypes.Node, error)

func (*XMLTextReader) Depth

func (r *XMLTextReader) Depth() int

func (*XMLTextReader) Free

func (r *XMLTextReader) Free()

Free releases the underlying C struct

func (*XMLTextReader) MoveToAttributeNo

func (r *XMLTextReader) MoveToAttributeNo(no int) error

func (*XMLTextReader) MoveToElement

func (r *XMLTextReader) MoveToElement() error

func (*XMLTextReader) MoveToFirstAttribute

func (r *XMLTextReader) MoveToFirstAttribute() error

func (*XMLTextReader) MoveToNextAttribute

func (r *XMLTextReader) MoveToNextAttribute() error

func (*XMLTextReader) Name

func (r *XMLTextReader) Name() string

func (*XMLTextReader) NodeType

func (r *XMLTextReader) NodeType() myXMLclib.XMLReaderType

func (*XMLTextReader) Pointer

func (r *XMLTextReader) Pointer() uintptr

Pointer returns the pointer to the underlying C struct

func (*XMLTextReader) SetParserProp

func (r *XMLTextReader) SetParserProp(prop myXMLclib.XMLParserProperties, value int) error

func (*XMLTextReader) SetSchema

func (r *XMLTextReader) SetSchema(schema *XMLxsd.Schema) error

func (*XMLTextReader) TextRead

func (r *XMLTextReader) TextRead() int

The main iterator method. Named "TextRead" rather than just "Read" to avoid obvious problems.

func (*XMLTextReader) Value

func (r *XMLTextReader) Value() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳