pub fn to_xml(
file: &str,
output: Option<&str>,
pretty: bool,
) -> Result<(), CliError>Expand description
Convert a HEDL file to XML format.
Parses a HEDL file and converts it to XML, with optional pretty-printing.
§Arguments
file- Path to the HEDL file to convertoutput- Optional output file path. IfNone, writes to stdoutpretty- Iftrue, pretty-prints the XML with indentation
§Returns
Returns Ok(()) on success.
§Errors
Returns Err if:
- The file cannot be read
- The file contains syntax errors
- XML conversion fails
- Output writing fails
§Examples
use hedl_cli::commands::to_xml;
// Convert to compact XML on stdout
to_xml("data.hedl", None, false)?;
// Convert to pretty XML file
to_xml("data.hedl", Some("output.xml"), true)?;