If this is related at all, or helps any, this is what I use to decode
entities from an XML string - someone on this list suggested using
XML.parseXML()

        private function decodeEntities(entityString:String):String {
                var x:XML = new XML("<n>"+entityString+"</n>"); 
                x.parseXML();
                return x.firstChild.firstChild.nodeValue;
        };




Jason Merrill
Bank of America 
Learning & Organization Effectiveness - Technology Solutions 
 
 
 
 
 

>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of Doug Coning
>>Sent: Monday, September 25, 2006 11:16 AM
>>To: Flashcoders mailing list
>>Subject: [Flashcoders] DECODE XML Encoded Characters?
>>
>>Alright, what am I doing wrong?  I have tried over and over to decode
an
>>XML string, but Flash won't decode it.  The XML is returning special
>>Characters (&'><) encoded.  I have tried to use escape, unescape,
>>encode, decode and I can't get anything to convert the encoded text to
>>its character representation.
>>
>>Here is the node:
>>
>><ConfigParamValue>Special Characters - &amp;  &quot;  &apos;  &lt;
&gt;
>></ConfigParamValue>
>>var str:String = String(XPath.selectNodes(MyXML_cs.getResults(),
>>"//ConfigParamValue/text()")[0]);
>>
>>I've tried:
>>trace("A: " + escape(str));    // > Special Character - &amp;  &quot;
>>&apos;  &lt;  &gt;
>>trace("B: " + unescape(str));  // > Special Character - &amp;  &quot;
>>&apos;  &lt;  &gt;
>>trace("C: " + decode(str));    // >
>>Special%20Character%20%2D%20%26amp%3B%20%20%26quot%3B%20%20%26apos%3B
>>%20
>>%20%26lt%3B%20%20%26gt%3B%20%20
>>trace("D: " + encode(str));    // > Special Character - &amp;  &quot;
>>&apos;  &lt;  &gt;
>>
>>I'd greatly appreciate if someone could let me know how to decode this
>>text!  Thank you!
>>
>>Doug Coning
>>Senior Web Development Programmer
>>FORUM Solutions
>>[EMAIL PROTECTED]
>>
>>This e-mail and any attachment(s) are intended for the specified
recipient(s) only
>>and are legally protected.  If you have received this communication in
error,
>>please "reply to" sender's e-mail address with notification of the
error and then
>>destroy this message in all electronic and physical forms.
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to