나는 큰 xml을 grails에서 flex로 넘겼습니다. flex가 xml을 수신하면 xml을 연관 배열 객체로 변환합니다. 큰 xml 파일이 주어지면 루프를 완료하는 데 너무 오래 걸립니다. flex를 사용하면 변환 속도가 빨라 집니까? 아래는 샘플 코드입니다.xml을 배열로 바꾸는 빠른 방법 (grails to flex)
<xml>
<car>
<model>Vios</model>
<type>Sedan</type>
<color>Blue</color>
</car>
<car>
<model>Camry</model>
<type>Luxury</type>
<color>Black</color>
</car>
</xml>
*converted to the flex associative array below.*
[Vios].type = Sedan
.color = Blue
[Camry].type = Luxury
.color = Black
*Below is a code I used in flex to convert the xml to the associative array object*
var tempXML=xml.children()
var tempArray:Array= new Array()
for(var i:int=0;i<tempXML.length();i++)
{
tempArray[tempXML[i][email protected]]= new Object();
tempArray[tempXML[i][email protected]].color = tempXML[i][email protected]();
tempArray[tempXML[i][email protected]].type = tempXML[i][email protected]();
}
XML을 어떻게 가져 오나요? HTTPService 사용? – ilikeorangutans
예, httpservice를 통해 xml을 검색합니다. –