# Entity-escaping Flash text to write to XML

**URL:** <https://forum.kirupa.com/t/entity-escaping-flash-text-to-write-to-xml/288780>\
**Category:** programming\
**Created:** [May 20, 2009, 8:59pm UTC](https://forum.kirupa.com/t/entity-escaping-flash-text-to-write-to-xml/288780 "2009-05-20T20:59:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thalamus](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@thalamus](https://forum.kirupa.com/u/thalamus)\
**Post date:** [May 20, 2009, 8:59pm UTC](https://forum.kirupa.com/t/entity-escaping-flash-text-to-write-to-xml/288780/1 "2009-05-20T20:59:24Z")

</div>

Hello: I’m trying to expand on the Simple XML Editor in Flash to entity-escape the 5 special characters so they can be used in a CMS.

Say I have an XML file with the following node:

\<item text=“Apples & Oranges” /\> (entity-escaped)

If I entity-escape the ampersand by editing the raw XML file, then when I load the XML node into Flash, Flash displays the data correctly:

Apples & Oranges

However if I entity-escape the ampersand with XML editor in Flash:

var escapedString:String = origString(replace all “&” with “&”)  
input\_xml.firstChild.lastChild.attributes.text = escapedString;

then send the data to be written to the XML file, Flash ignores the entity-escaping and displays:

Apples & Oranges

XML is encoded as UTF-8 (no BOM) with a DTD.
