2010-02-13 3 views
1

RSS 리더 만들기. 한 가지 특징은 피드의 여러 "카테고리"노드를 구문 분석해야한다는 것입니다. 그러나 피드를로드 할 때 카테고리가 텍스트 영역에 표시되지 않습니다. Flash는 오류를 반환하지 않습니다. Heres는 코드Flash AS3 - htmltext를 사용하여 텍스트 영역에 XMLList 값 게시

-

var curStory = rssXML.channel.item[evt.target.selectedIndex] 
var catlist:XMLList = curStory.category; 
taLog.htmlText = curStory.description + catlist[1]; 

주 - curStory.descriptioncatlist[1]없이 잘 구문 분석 및 추적 내가 원하는 값을 반환합니다.

답변

0

네임 스페이스가 누락 된 것처럼 보입니다.

var ns:Namespace = new Namespace("http://www.w3.org/2005/Atom"); 
var curStory = rssXML.ns::channel.ns::item[evt.target.selectedIndex] 
var catlist:XMLList = curStory.ns::category; 
taLog.htmlText = curStory.ns::description + catlist[1]; 

아니면 default xml namespace를 사용하고 기존 코드를 계속 할 수 있습니다

default xml namespace = new Namespace("http://www.w3.org/2005/Atom"); 
var curStory = rssXML.channel.item[evt.target.selectedIndex] 
var catlist:XMLList = curStory.category; 
taLog.htmlText = curStory.description + catlist[1]; 
관련 문제