xmlization

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package xmlization de/serializes model instances to and from XML.

To de-serialize, call one of the `Unmarshal*` functions.

To serialize, call the Marshal function.

Index

Constants

View Source
const Namespace = "https://admin-shell.io/aas/3/0"

Variables

This section is empty.

Functions

func Marshal

func Marshal(
	encoder *xml.Encoder,
	that aastypes.IClass,
	withNamespace bool,
) (err error)

Serialize `that` instance as an XML element.

If `withNamespace` is set, the `xmlns` attribute is set in the XML element to Namespace.

func Unmarshal

func Unmarshal(
	decoder *xml.Decoder,
) (instance aastypes.IClass, err error)

Unmarshal an instance of aastypes.IClass serialized as an XML element.

The XML element must live in the Namespace space.

Types

type DeserializationError

type DeserializationError struct {
	Path    *aasreporting.Path
	Message string
}

Represent an error during the de-serialization.

Implements `error`.

func (*DeserializationError) Error

func (de *DeserializationError) Error() string

func (*DeserializationError) PathString

func (de *DeserializationError) PathString() string

Render the path as a string.

type SerializationError

type SerializationError struct {
	Path    *aasreporting.Path
	Message string
}

Represent an error during the serialization.

Implements `error`.

func (*SerializationError) Error

func (se *SerializationError) Error() string

func (*SerializationError) PathString

func (se *SerializationError) PathString() string

Render the path as a string.

Jump to

Keyboard shortcuts

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