skbot.ignition.sdformat.loads¶
- skbot.ignition.sdformat.loads(sdf, *, version=None, custom_constructor=None, handler=None)[source]¶
Convert an XML string into a sdformat.models tree.
- Parameters
- sdfstr
The SDFormat XML to be parsed.
- versionstr
The SDFormat version to use while parsing. If None (default) it will automatically determine the version from the <sdf> element. If specified the given version will be used instead.
- custom_constructorDict[Type[T], Callable]
Overwrite the default constructor for a certain model class with callable. This is useful for doing pre- or post-initialization of bound classes or to replace them entirely.
- handlerstr
The handler that the parser should use when traversing the XML. If unspecified the default xsData parser will be used (lxml if it is installed, otherwise xml.etree). Possible values are:
- “XmlEventHandler”
A xml.etree event-based handler.
- “LxmlEventHandler”
A lxml.etree event-based handler.
- Returns
- SdfRootobject
An instance of
skbot.ignition.models.vXX.Sdf
where XX corresponds to the version of the SDFormat XML.
Notes
custom_constructure
is currently disabled and has no effect. It will become available with xsData v21.8.Examples