I have some problems reading random size and construction XML files.
Example: if u know the construction of file it is no problem, but when trying to display XML data that is unknown structure is more dif.
Any suggestions how to read such file?
I tried reading entire file into String then trying to manipulate it and have big problems:
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, getXML);
loader.load(new URLRequest("domov.xml"));
function getXML(event:Event):void {
var xmlData:XML = new XML(event.target.data);
var besedilo:String = xmlData;
trace(besedilo);
}
XML file example:
<?xml version="1.0" encoding="UTF-8"?>
<rss>
<channel>
<item id="1">
<title>DOBRODOŠLI NA NAŠI STRANI</title>
<image>slike/domov/1.jpg</image>
<description><![CDATA[<span class='green'>then some text that is css ormated</span> with a link <a href="http://somelink.com">click</a>.]]></description>
</item>
<item id="2">
<title>POSODOBITEV</title>
<image>slike/domov/2.jpg</image>
<description> <![CDATA[ We had something years ago.]]></description>
</item>
</channel>
</rss>