簡體   English   中英

Flex 3中的XML和XMLList以及XMLListCollection

[英]XML and XMLList and XMLListCollection in Flex 3

請解釋一下XML和XMLList以及XMLListCollection之間的區別。 如果可能的話用簡單的話說明。 提前致謝。

首先,指向Flex 3語言參考的鏈接 - 必須有用於查找此內容的書簽。

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html

XML

返回XMLList

的XMLListCollection

其次,我要檢查XMLList的Examples鏈接,因為它在XML和XMLList的區別之間提供了一個很好的工作示例。

如果要使用XML文檔的值創建變量,請使用XML。

var mybooks:XML = <books>
  <book>
    <title>Book1</title>
  </book>
  <book>
     <title>Book2</title>
  </book>
</books>;

使用XMLList從XML變量創建數據子集。

var mybookTitles:XMLList = mybooks.title;  

最后,XMLListCollection類基本上是一個輔助類,用於獲取XML或XMLList對象並在控件中使用它。

從其dataProvider屬性的mx.core.Repeater文檔中獲取此片段

If you set it to an XML or XMLList, it is converted into an XMLListCollection.

希望這可以幫助

XMLListCollection可能就是您想要使用的。 它具有數據綁定功能,可以很好地用作數據網格中的數據源。

XMLListCollection是從XMLList構建的。 但是,在從XMLList創建XMLListCollection之后,很少(如果有的話)再次使用XMLList。

我很少使用XML。 我認為XML主要用於向后兼容,並且鼓勵您使用XMLList和XMLListCollection。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM