Показать сообщение отдельно
Старый 24.12.2009, 17:30
wvxvw вне форума Посмотреть профиль Отправить личное сообщение для wvxvw Найти все сообщения от wvxvw
  № 2  
Ответить с цитированием
wvxvw
Modus ponens
 
Аватар для wvxvw

модератор форума
Регистрация: Jul 2006
Адрес: #1=(list #1#)
Сообщений: 8,049
Записей в блоге: 38
Код AS3:
var xml:XML = 
<response>
    <item>
        <id>1</id>
        <cost>150</cost>
        <period>1</period>
    </item>
    <item>
        <id>1</id>
        <cost>100</cost>
        <period>2</period>
    </item>
    <item>
        <id>2</id>
        <cost>70</cost>
        <period>1</period>
    </item>
     <item>
         <id>2</id>
         <cost>90</cost>
        <period>2</period>
     </item>
</response>;
var d:Dictionary = new Dictionary();
 
var list:XMLList = xml.item.id.(!d[valueOf().text().toString()] && 
				(d[valueOf().text().toString()] = true));
trace(list.toXMLString());
/*
<id>1</id>
<id>2</id>
*/
__________________
Hell is the possibility of sanity