PDA

View Full Version : parsing xml data with colons in it



darkerthoughts
April 9th, 2009, 10:12 PM
Hi all, I'm creating a frontend for a podcasting website. It will basically run from an xml feed produced by podpress. This isn't particularly important.

My question is, how do I import xml entries with colons ":" in them. For example the line highlighted below.



<item>
<title>podcast1</title>
<pubDate>Thu, 09 Apr 2009 21:47:35 +0000</pubDate>
<dc:creator>admin</dc:creator>
<category><![CDATA[Uncategorized]]></category>
<itunes:duration>0:03</itunes:duration>
<itunes:subtitle>content</itunes:subtitle>
<itunes:summary>content</itunes:summary>
<itunes:keywords>Uncategorized</itunes:keywords>
<itunes:author>qweqw@dasdasd.com</itunes:author>
<itunes:explicit>no</itunes:explicit>
<itunes:block>No</itunes:block>
</item>


This is the basic code I'm using to import the regular xml lines (it was taken from a kirupa tutorial and works fine).



var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

xmlLoader.load(new URLRequest("ADDRESS"));

function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBooks(xmlData);
}

function ParseBooks(bookInput:XML):void {
trace("XML Output");
trace("------------------------");

trace(bookInput.channel.item.title);
}


So... for example... how do I get the line "<itunes:subtitle>content</itunes:subtitle>" when "itunes:subtitle" isn't being recognised?

Many thanks in advance!

Krilnon
April 9th, 2009, 10:14 PM
http://www.kirupa.com/forum/showthread.php?t=322995

darkerthoughts
April 9th, 2009, 11:08 PM
Perfect!