xmlutil

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFromXML

func RunFromXML(w io.Writer, r io.Reader, args []string, opts FromXMLOptions) error

RunFromXML converts XML to JSON

func RunToXML

func RunToXML(w io.Writer, r io.Reader, args []string, opts ToXMLOptions) error

RunToXML converts JSON to XML

Types

type FromXMLOptions

type FromXMLOptions struct {
	AttrPrefix string // Prefix for attributes in JSON (default: "-")
	TextKey    string // Key for text content (default: "#text")
}

FromXMLOptions configures XML to JSON conversion

type ToXMLOptions

type ToXMLOptions struct {
	Root       string // Root element name (default: "root")
	Indent     string // Indentation (default: "  ")
	ItemTag    string // Tag for array items (default: "item")
	AttrPrefix string // Prefix for attributes (default: "-")
}

ToXMLOptions configures JSON to XML conversion

Jump to

Keyboard shortcuts

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