pub fn parse_str(xml: &str) -> Result<OpenScenario>Expand description
Parse an OpenSCENARIO document from a string
This is a convenience function that wraps parser::xml::parse_from_str
with additional context and error handling.
ยงExample
use openscenario_rs::parse_str;
let xml = r#"
<?xml version="1.0" encoding="UTF-8"?>
<OpenSCENARIO>
<FileHeader author="Test" date="2024-01-01" description="Test" revMajor="1" revMinor="0"/>
<Entities/>
<Storyboard><Init><Actions/></Init></Storyboard>
</OpenSCENARIO>
"#;
let scenario = parse_str(xml)?;