xml类

package
v0.0.0-...-2910145 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gxml 提供了对 XML 内容的访问和转换功能。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(content []byte) (map[string]interface{}, error)

Decode 解析 `content` 并将其转换为 map 后返回。

func DecodeWithoutRoot

func DecodeWithoutRoot(content []byte) (map[string]interface{}, error)

DecodeWithoutRoot 将 `content` 解析为一个映射(map),并返回没有根级别的映射。

func Encode

func Encode(m map[string]interface{}, rootTag ...string) ([]byte, error)

Encode 将字典 `m` 编码为 XML 格式的内容并以字节形式输出。 可选参数 `rootTag` 用于指定 XML 根标签。

func EncodeWithIndent

func EncodeWithIndent(m map[string]interface{}, rootTag ...string) ([]byte, error)

EncodeWithIndent 将 map `m` 编码为带有缩进的 XML 格式字节内容。 可选参数 `rootTag` 用于指定 XML 根标签。

func ToJson

func ToJson(content []byte) ([]byte, error)

ToJson 将`content`以XML格式转换为JSON格式的字节流。

Types

This section is empty.

Jump to

Keyboard shortcuts

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