xmlutil

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeCanonical

func EncodeCanonical(enc *xml.Encoder, value any) error

EncodeCanonical marshals a value and rewrites the resulting token stream to: - declare namespaces once on the root element - keep the document namespace as the default namespace - use a stable prefix for XMLDSig nodes - keep xmlns declarations ahead of regular attributes

func EncodeNamespacedRoot added in v0.1.1

func EncodeNamespacedRoot(enc *xml.Encoder, rootLocal, namespace string, value any) error

EncodeNamespacedRoot marshals value, renames its root element to rootLocal, and declares namespace as the default namespace on it. Remaining canonical behavior matches EncodeCanonical. Useful to avoid per-root anonymous wrapper structs when the inner type carries no XMLName tag.

func FirstNonEmpty

func FirstNonEmpty(values ...string) string

func ParseRootElement

func ParseRootElement(data []byte) (xml.Name, error)

func ParseRootName

func ParseRootName(data []byte) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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