我已经看到在几个在线示例中使用了以下方法,但没有找到有关解析XML提要的推荐方法的任何文档.
方法1:
protected function xmlResponseHandler(event:ResultEvent):void
{
var atom:Namespace = new Namespace("http://www.w3.org/2005/Atom");
var microsoftData:Namespace = new Namespace("http://schemas.microsoft.com/ado/2007/08/dataservices");
var microsoftMetadata:Namespace = new Namespace("http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
var ac:ArrayCollection = new ArrayCollection();
var keyValuePairs:KeyValuePair;
var propertyList:XMLList = (event.result as XML)..atom::entry.atom::content.microsoftMetadata::properties;
for each (var properties:XML in propertyList)
{
keyValuePairs = new KeyValuePair(properties.microsoftData::FieldLocation, properties.microsoftData::Locationid);
ac.addItem(keyValuePairs);
}
cb.dataProvider = ac;
}
Run Code Online (Sandbox Code Playgroud)
方法2:
protected function xmlResponseHandler(event:ResultEvent):void
{
namespace atom = "http://www.w3.org/2005/Atom";
namespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
namespace m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
use namespace d;
use namespace m;
use namespace atom;
var ac:ArrayCollection …Run Code Online (Sandbox Code Playgroud)