pub fn text_from_text_event<'a>(
        mc: MutationContext<'gc, '_>,
        bt: BytesText<'a>,
        process_entity: bool,
    ) -> Result<Self, quick_xml::Error> {
        let contents = if process_entity {
            bt.unescaped()?
        } else {
            Cow::Borrowed(bt.escaped())
        };

        Ok(XmlNode(GcCell::allocate(
            mc,
            XmlNodeData::Text {
                script_object: None,
                attributes_script_object: None,
                parent: None,
                prev_sibling: None,
                next_sibling: None,
                contents: AvmString::new_utf8_bytes(mc, contents)?,
            },
        )))
    }
/// Construct an XML Text node from a `quick_xml` `BytesText` event.
///
/// The returned node will always be `Text`, and it must only contain
/// valid encoded UTF-8 data. (Other encoding support is planned later.)
Construct an XML Text node from a `quick_xml` `BytesText` event.
The returned node will always be `Text`, and it must only contain
valid encoded UTF-8 data. (Other encoding support is planned later.)
Construct an XML Text node from a ` quick_xml ` ` BytesText ` event . The returned node will always be ` Text ` and it must only contain valid encoded UTF - 8 data . ( Other encoding support is planned later . )
pub fn text_from_text_event<'a>(
        mc: MutationContext<'gc, '_>,
        bt: BytesText<'a>,
        process_entity: bool,
    ) -> Result<Self, quick_xml::Error> {
        let contents = if process_entity {
            bt.unescaped()?
        } else {
            Cow::Borrowed(bt.escaped())
        };
        Ok(XmlNode(GcCell::allocate(
            mc,
            XmlNodeData::Text {
                script_object: None,
                attributes_script_object: None,
                parent: None,
                prev_sibling: None,
                next_sibling: None,
                contents: AvmString::new_utf8_bytes(mc, contents)?,
            },
        )))
    }
pub fn text_from_text_event < ' a > ( mc : MutationContext < ' gc , ' _ > , bt : BytesText < ' a > , process_entity : bool , ) -> Result < Self , quick_xml :: Error > { let contents = if process_entity { bt . unescaped ( ) ? } else { Cow :: Borrowed ( bt . escaped ( ) ) } ; Ok ( XmlNode ( GcCell :: allocate ( mc , XmlNodeData :: Text { script_object : None , attributes_script_object : None , parent : None , prev_sibling : None , next_sibling : None , contents : AvmString :: new_utf8_bytes ( mc , contents ) ? , } , ) ) ) }
Construct an XML Text node from a `quick_xml` `BytesText` event.
Construct an XML Text node from a ` quick_xml ` ` BytesText ` event .
mc
MutationContext<'gc, '_>
bt
BytesText<'a>
process_entity
bool