xmlutil

package
v0.0.0-...-fd57926 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddElement

func AddElement(path string, parentElement string, newElement string, value string) error

AddElement adds a new element to an XML file

func CreateXMLFile

func CreateXMLFile(path string, rootElement string) error

CreateXMLFile creates a new XML file with the given root element.

func DeleteElement

func DeleteElement(path string, elementName string) error

DeleteElement removes an XML element from a file

func ExtractElementValue

func ExtractElementValue(xmlStr, elementName string) (string, error)

ExtractElementValue extracts the text content of a specified XML element.

func MarshalXML

func MarshalXML(v any, indent bool) ([]byte, error)

MarshalXML marshals a struct into an XML byte slice.

func ReadXMLFile

func ReadXMLFile(path string) ([]byte, error)

ReadXMLFile reads an XML file and returns its contents as a byte slice.

func UnmarshalXML

func UnmarshalXML(data []byte, v any) error

UnmarshalXML unmarshals XML data into a provided struct.

func UpdateElement

func UpdateElement(path string, elementName string, newValue string) error

UpdateElement modifies the value of an XML element in a file

func WriteXMLFile

func WriteXMLFile(path string, v any) error

WriteXMLFile writes XML data to a file with indentation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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