core

package
v0.0.0-...-84e4751 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package core implements XML decoding, streaming, and encoding logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attr

func Attr(ctx context.Context, value runtime.Value, name runtime.String) (runtime.Value, error)

func Children

func Children(ctx context.Context, value runtime.Value) (runtime.Value, error)

func Decode

func Decode(ctx context.Context, data runtime.String) (runtime.Value, error)

Decode eagerly decodes XML text into a normalized document object.

func Encode

func Encode(ctx context.Context, value runtime.Value) (string, error)

Encode serializes a normalized XML document or element into XML text.

func ResolveContent

func ResolveContent(input runtime.Value) (runtime.String, error)

ResolveContent normalizes supported XML content input to a runtime.String. It accepts only runtime.String and runtime.Binary values.

func Root

func Root(ctx context.Context, value runtime.Value) (runtime.Value, error)

func Text

func Text(ctx context.Context, value runtime.Value) (runtime.Value, error)

Types

type DecodeIterator

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

DecodeIterator iterates over normalized XML events.

func NewDecodeIterator

func NewDecodeIterator(data runtime.String) (*DecodeIterator, error)

NewDecodeIterator returns an iterator over normalized XML events.

func NewDecodeIteratorFromReader

func NewDecodeIteratorFromReader(reader io.Reader) (*DecodeIterator, error)

NewDecodeIteratorFromReader returns an iterator over normalized XML events read directly from an io.Reader.

func (*DecodeIterator) Close

func (d *DecodeIterator) Close() error

Close stops the iterator.

func (*DecodeIterator) Iterate

Iterate returns the iterator itself.

func (*DecodeIterator) Next

Next returns the next XML event and its 1-based event number.

type Error

type Error struct {
	Err error
	Msg string
}

Error reports XML-specific decode and encode failures.

func (*Error) Error

func (e *Error) Error() string

Error formats the XML error with the module prefix.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the wrapped error, when present.

Jump to

Keyboard shortcuts

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