xml

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	OnStart func(StartElement)
	OnEnd   func(xml.EndElement)
	OnChar  func(xml.CharData)
	// contains filtered or unexported fields
}

A Decoder represents an XML parser reading a particular input stream. The parser assumes that its input is encoded in UTF-8.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder creates a new XML parser reading from r. If r does not implement io.ByteReader, NewDecoder will do its own buffering.

func (*Decoder) RawToken

func (d *Decoder) RawToken() error

type Printer

type Printer struct {
	*bufio.Writer
	AutoClose      bool
	SkipAttrEscape bool
	// contains filtered or unexported fields
}

func (*Printer) EscapeString

func (p *Printer) EscapeString(s string)

EscapeString writes to p the properly escaped XML equivalent of the plain text data s.

func (*Printer) WriteEnd

func (p *Printer) WriteEnd(name xml.Name)

func (*Printer) WriteStart

func (p *Printer) WriteStart(start *xml.StartElement)

WriteStart writes the given start element.

type StartElement

type StartElement struct {
	Name xml.Name
	Attr []XMLAttr
}

type XMLAttr

type XMLAttr struct {
	Name  xml.Name
	Value []byte
}

Jump to

Keyboard shortcuts

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