Documentation
¶
Overview ¶
Package lib exposes the Ferret-facing XML:: functions.
Index ¶
- func Attr(ctx context.Context, value, name runtime.Value) (runtime.Value, error)
- func Children(ctx context.Context, value runtime.Value) (runtime.Value, error)
- func Decode(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func DecodeStream(_ context.Context, args ...runtime.Value) (runtime.Value, error)
- func Encode(ctx context.Context, args ...runtime.Value) (runtime.Value, error)
- func RegisterLib(ns runtime.Namespace)
- func Root(ctx context.Context, value runtime.Value) (runtime.Value, error)
- func Text(ctx context.Context, value runtime.Value) (runtime.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attr ¶
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 ¶
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 ¶
Decode decodes XML content into a normalized document object. @param {String|Binary} data - XML content. @return {Object} - Normalized XML document.
func DecodeStream ¶
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 ¶
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 ¶
RegisterLib registers the XML namespace functions in the provided namespace.
Types ¶
This section is empty.