That's my xml node:
<node att="something < something else"> </node>
When i write in my code :
trace(xml.node.@att.toStrin开发者_Python百科g());
it prints out the string :
something < something else
My problem is that i need to print out the orriginal string:
something $lt; something else //put $ instead of &
Does anyone know how to solve this?
Thanks in advance.
Hey ! Just tried this and it seems to work... : )
var xml:XML=<node att="something < something else"> </node>;
trace(xml.toXMLString());//<node att="something < something else"/>
trace(xml.@att.toXMLString());//something < something else
The basic XML Parser will unespace them.
If you want the converted char again, you'll need to reconvert it again using ActionScript 3.
You can also convert it twice, using &lt;
Option 1 - USE <![CDATA[ ]]>
<chapter title="hello" nr="111" src="">
<page>
<text><![CDATA[To adjust <br/><br/>. . . ]]></text>
<text><![CDATA[To adjust <br/><br/>. . . ]]></text>
</page>
</chapter>
Option 2 - use <
and >
for < and >
Then <br/>
= <b/>
精彩评论