| Ultrashock Forums
• (AS2) XML - convert < to read as HTML |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2009-03-25
#2 |
||
|
|
2009-03-25
#3 |
||
|
As you found out, the problem is not how PHP interprets the page, its how Flash does. Take a look at your raw php generated XML in a browser and you will not see those characters. nodeValue is the solution you are looking for.
|
|
|
2009-03-26
#4 |
||
|
almost there
Thanks for your help, this is looking good. It's returning "null" at the moment. Can you figure out what's happening? Here's what I've got: AS2 ActionScript Code:
XML: Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <songs> <song trackTitle="track tite1"> <moreInfo><![CDATA[ <b>Abstract Painting</b>< br />1963<br />170.00 x 215.00 cm<br />Oil on canvas< br />Catalogue Raisonné: 144<br />Collection: K21 Kunstsammlung, D&uuml;sseldorf, Germany<br />Audio courtesy of <u>< a href='http://:www.acoustiguide.com' target='_blank'> Acoustiguide</a></u>]]></moreInfo> </song> </songs> |
|
|
2009-03-26
#5 |
||
|
Last edited by Luke.F : 2009-03-26 at 08:19.
Hi, All fixed! Thanks for your help. I out that i was declaring a var that messed with it. Basically, nodeValue worked a treat. Thanks UShock team. full solution: mainNode.childNodes[moreInformation].childNodes[0].nodeValue.split("<").join("<").split(">").join(">"); |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


4 comments
| 1320 views



Linear Mode
Here's a test I ran
var m:String= "<items><one>plain</one><two><![CDATA[this is <i>italic</i>]]></two></items>"; var my_xml:XML = new XML(m); trace("using firstChild:"); for (var i = 0; i<my_xml.firstChild.childNodes.length; i++) { trace("\t"+my_xml.firstChild.childNodes[i].firstChild); } trace(""); trace("using firstChild.nodeValue:"); for (var i = 0; i<my_xml.firstChild.childNodes.length; i++) { trace("\t"+my_xml.firstChild.childNodes[i].firstChild.nodeValue); }