lib

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: 4 Imported by: 0

Documentation

Overview

Package lib exposes the Ferret-facing XML:: functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attr

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

Attr returns the named attribute value for an XML element-like node. @param {Object} value - XML document, element, or text node. @param {String} name - Attribute name. @return {String|None} - Attribute value or None.

func Children

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

Children returns the child nodes for an XML document or element. @param {Object} value - XML document, element, or text node. @return {Any[]} - Child nodes or an empty array for text nodes.

func Decode

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

Decode decodes XML content into a normalized document object. @param {String|Binary} data - XML content. @return {Object} - Normalized XML document.

func DecodeStream

func DecodeStream(_ context.Context, args ...runtime.Value) (runtime.Value, error)

DecodeStream decodes XML content lazily into normalized XML events. @param {String|Binary} data - XML content. @return {Iterator<Object>} - Proxy exposing an iterator over XML events.

func Encode

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

Encode serializes a normalized XML document or element into XML text. @param {Object} value - Normalized XML document or element. @return {String} - XML text.

func RegisterLib

func RegisterLib(ns runtime.Namespace)

RegisterLib registers the XML namespace functions in the provided namespace.

func Root

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

Root returns the root element for a document or the element itself. @param {Object} value - XML document, element, or text node. @return {Object|None} - Root or element node, or None for text nodes.

func Text

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

Text returns the descendant text content for an XML node. @param {Object} value - XML document, element, or text node. @return {String} - Concatenated text content.

Types

This section is empty.

Jump to

Keyboard shortcuts

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