Rust
Rust
Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.Chilkat Rust Downloads
// Load an XML file containing the following:
// <?xml version="1.0" encoding="UTF-8"?>
// <output>Französische</output>
let xml = chilkat::Xml::new();
let _ = xml.load_xml_file("qa_data/xml/hasHtmlEntity.xml").is_ok();
// Get non-decoded content, then get decoded content.
// Result is Französische
println!("{}", xml.content());
// Result is Französische
let str_decoded = xml.decode_entities(&xml.content()).unwrap_or_default();
println!("{}", str_decoded);