As far as I know, there is not built-in way to do this.

 

There are many different solutions, including tricks with xml, and a base 64
encoder that apparently does this as a side effect, and I saw one manual
replacement class that looked very complete.

 

I have not had to work with completely free test and have used a combination
of manual replacement and controlling the allowed input characters.

 

You will need to choose the solution that best fits your needs.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Peter Valdemar Mørch
Sent: Friday, February 05, 2010 10:39 AM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [flexcoders] Encoding XML Character Entity References
*properly*

 

  

Hi, I didn't get any replies, so here is a polite bump...

My question is basically this: How do I create an XML node with a
toXMLString() value of:

<value>a &lt;foo&gt;string&lt;/foo&gt;/&amp;</value>

from a value of

var value:String = "a <foo>string</foo>/&";

Is this really something one is expected to code by hand using RegExp
or split&join? Isn't this something everybody who needs to send /
recieve XML needs to be safe? I just can't find it anywhere.

Also, I wrote:
> P.S.: Please don't tell me about escape() because it URL-encodes,
> which is not the same thing. (For "a&b" I want "a&amp;b", not
> "a%26b).

Sorry if this offended anyone. I didn't mean to be rude.

Peter
-- 
Peter Valdemar Mørch
http://www.morch. <http://www.morch.com> com



Reply via email to