-
Notifications
You must be signed in to change notification settings - Fork 8
richardszalay edited this page May 20, 2011
·
9 revisions
Creates an observable sequence that loads and parses XML
static function xml(request:URLRequest,
loaderContext:LoaderContext = null) : IObservable.<XML>
The returned sequence emits the XML and completes after it loads successfully.
The returned sequence returns an error if there is a SecurityError or IOError loading the content, or if there is an error parsing the XML.
IObservable.<XML>
namespace atom = "http://www.w3.org/2005/Atom";
var raixWikiFeedURL : URLRequest =
new URLRequest("http://wiki.github.com/richardszalay/raix/wikis.atom");
var latestRaixWiki : IObservable = Observable.xml(raixWikiFeedURL)
.map(String, function(feed : XML) : String
{
use namespace atom;
return feed.entry[0].title.toString();
});
latestRaixWiki.subscribe(function(entryTitle : String) : void
{
trace("The latest raix wiki page updated was: " + entryTitle);
});
// Trace output is:
// The latest raix wiki page updated was: xml