Versions in this module Expand all Collapse all v0 v0.1.0 Jun 7, 2022 v0.0.2 Jun 7, 2022 v0.0.1 Sep 1, 2021 Changes in this version + const Attrib + const BeginContent + const CData + const CloseEmptyTag + const Comment + const DocTypeDecl + const EOF + const EndContent + const Err + const ErrCodeExpectedAttrName + const ErrCodeExpectedEQ + const ErrCodeExpectedOTag + const ErrCodeExpectedQStr + const ErrCodeInvalidSchema + const ErrCodeInvalidXmlDecl + const ErrCodeMissingRoot + const ErrCodeOk + const ErrCodeUnexpectedContent + const ErrCodeUnexpectedEOF + const ErrCodeUnsupportedFeature + const ErrCodeUnterminatedCDATA + const ErrCodeUnterminatedQStr + const ErrCustom + const ErrInvalidComment + const ErrMismatchingTag + const ErrUnterminatedComment + const ErrUnterminatedPI + const PI + const SData + const Tag + const XmlDecl + var ErrNoMoreContent = errors.New("no more content available") + func CalcLocation(buf string, byteoffset int) (line, pos int) + func NewError(ec ErrCode, buf string, offset int) error + func ParseTokens(buf string, ontoken func(t *Token) error) error + type AttributeList []*Token + func (aa AttributeList) Attr(name string) (string, bool) + type Content struct + func Open(buf string) *Content + func (ci *Content) ChildStringContent() RawString + func (ci *Content) Err() error + func (ci *Content) HandleTag(callback func(attrs AttributeList, content *Content) error) + func (ci *Content) IsCData() bool + func (ci *Content) IsComment() bool + func (ci *Content) IsPI() bool + func (ci *Content) IsSData() bool + func (ci *Content) IsTag() bool + func (ci *Content) IsXmlDecl() bool + func (ci *Content) Kind() TokenKind + func (ci *Content) MakeError(prefix, msg string) error + func (ci *Content) Name() NameString + func (ci *Content) Next() (ok bool) + func (ci *Content) NextTag() bool + func (ci *Content) Raw() (whitePrefix, tokenStr string) + func (ci *Content) Value() RawString + type ContentHandler = func(t *Token) error + type ErrCode int + func (ec ErrCode) Failed() bool + func (ec ErrCode) String() string + func (ec ErrCode) Succeeded() bool + type Marshaler interface + MarshalXG func(w *Writer) error + type NameString string + type RawString string + func (rs RawString) Unscrambled() string + type TagHandler func(tag *Token, attrs AttributeList, content *Content) error + type Token struct + Error error + Kind TokenKind + Name NameString + Raw string + SrcPos int + Value RawString + WhitePrefix string + func (t *Token) IsDone() bool + func (t *Token) IsError() bool + type TokenKind int + func (t TokenKind) String() string + type UnsupportedTypeError struct + Type reflect.Type + func (e *UnsupportedTypeError) Error() string + type Writer struct + func NewWriter(out io.Writer) *Writer + func (w *Writer) Attr(name string, value interface{}) + func (w *Writer) BOM() + func (w *Writer) BeginContent() + func (w *Writer) CTag() + func (w *Writer) Comment(s string) + func (w *Writer) OTag(name string) + func (w *Writer) OptAttr(name string, value interface{}) + func (w *Writer) OptStringAttr(name string, value string) + func (w *Writer) String(s string) + func (w *Writer) StringAttr(name string, value string) + func (w *Writer) Write(v interface{}) + func (w *Writer) XmlDecl()