Documentation ¶
Overview ¶
Package xmlparse contains tools for xml parsing
Index ¶
- func GetStrFrom(items []string) string
- func NewDecoder(reader io.Reader) *xml.Decoder
- func TokenRead(tokenName string, reader TokenReader) (res string, err error)
- func TokenSkip(tokenName string, reader TokenReader) (err error)
- func Unmarshal(data []byte, v any) (err error)
- type Rule
- type TokenHandler
- type TokenReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStrFrom ¶
GetStrFrom returns first not empty string from slice.
func NewDecoder ¶
NewDecoder creates decoder for xml data.
func TokenRead ¶
func TokenRead(tokenName string, reader TokenReader) (res string, err error)
TokenRead returns xml token inner content.
func TokenSkip ¶
func TokenSkip(tokenName string, reader TokenReader) (err error)
TokenSkip skips current token at reader.
Types ¶
type TokenHandler ¶
type TokenHandler func(interface{}, xml.StartElement, TokenReader) error
TokenHandler handler for fb2 tokens.
func WrapRules ¶
func WrapRules(rules []Rule, handler TokenHandler) TokenHandler
WrapRules builds chain of rules.
type TokenReader ¶
type TokenReader interface { xml.TokenReader }
TokenReader token reader interface.
Click to show internal directories.
Click to hide internal directories.