BB.Urdf.Xml (bb v0.15.0)

View Source

XML building utilities using Erlang's xmerl library.

Summary

Functions

Build an xmerl element tuple.

Format a float with 6 decimal places, trimming trailing zeros.

Format a 3-tuple as space-separated values.

Convert an xmerl element tree to an XML string with declaration.

Functions

element(name, attrs \\ [], children \\ [])

@spec element(atom(), keyword(), list()) :: tuple()

Build an xmerl element tuple.

Attributes are converted to charlists as required by xmerl. Nil children are filtered out.

format_float(value)

@spec format_float(number()) :: String.t()

Format a float with 6 decimal places, trimming trailing zeros.

format_xyz(arg)

@spec format_xyz({number(), number(), number()}) :: String.t()

Format a 3-tuple as space-separated values.

to_string(xml_tree)

@spec to_string(tuple()) :: String.t()

Convert an xmerl element tree to an XML string with declaration.