Skip to main content

escape_xml

Function escape_xml 

Source
pub fn escape_xml(s: &str) -> String
Expand description

Escape special XML characters in text content and attribute values, replacing &, <, >, ", and ' with their XML entity equivalents.

ยงExamples

use fiscal_core::xml_utils::escape_xml;
assert_eq!(escape_xml("Tom & Jerry <cats>"), "Tom &amp; Jerry &lt;cats&gt;");