【问题标题】:get xml-field with property获取带有属性的 xml 字段
【发布时间】:2011-12-07 23:06:12
【问题描述】:

这是我的 xml 文件:

 <artist>
     <name>Have Heart</name>
     <playcount>2588</playcount>
     <tagcount>0</tagcount>
     <mbid>e519e012-e1a3-4592-b3f6-5a16227ab654</mbid>
     <url>http://www.last.fm/music/Have+Heart</url>
     <streamable>1</streamable>
     <image size="small">http://userserve-ak.last.fm/serve/34/29086375.jpg</image>
     <image size="medium">http://userserve-ak.last.fm/serve/64/29086375.jpg</image>
     <image size="large">http://userserve-ak.last.fm/serve/126/29086375.jpg</image>
     <image size="extralarge">http://userserve-ak.last.fm/serve/252/29086375.jpg</image>
     <image size="mega">
          http://userserve-ak.last.fm/serve/_/29086375/Have+Heart.jpg
     </image>
</artist>

我正在像这样遍历数据:

for each(artistXML in artistList.artists)
{
    var artistName:String = artistXML.artist.name;
    var artistPic:String = 
    insertArtistUrl = "http://localhost:8888/flexapp/insert_artist.php?";   
}

如何获得其中一个图像标签?比方说大的。

【问题讨论】:

    标签: xml actionscript-3 apache-flex actionscript


    【解决方案1】:

    试试这个:

    artistXML.artist.image.(@size=="large")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-30
      • 1970-01-01
      • 2015-01-25
      • 2012-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多