Search documentation of bb

# BB.Urdf.Xml (bb v0.17.0)

Copy Markdown View Source

XML building utilities using Erlang's xmerl library.

## Summary

### Functions

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

Build an xmerl element tuple.

format_float(value)

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

format_xyz(arg)

Format a 3-tuple as space-separated values.

to_string(xml_tree)

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.