2014-12-24 1 views
0
Below is the single item from XML : 
<item> 
<guid>http://www.businessinsider.com/european-markets-open-dec-24-2014-2014-12</guid> 
        <title>10 Things You Need Before European Markets Open</title> 
        <link>http://www.businessinsider.com/european-markets-open-dec-24-2014-2014-12</link> 
        <pubDate>Wed, 24 Dec 2014 02:52:00 -0500</pubDate> 
<media:thumbnail url="http://static6.businessinsider.com/image/549a70f0dd0895a63a8b4567/10-things-you-need-before-european-markets-open.jpg" /> 
                   <media:credit>REUTERS/Dylan Martinez</media:credit> 
            </item> 

모든 태그에 end 태그가 있습니다. thumnnail과 url 속성 값을 구문 분석해야합니다.Defaulthandler in android를 구문 분석하십시오.

+0

""예 – pskink

+0

예하지만 startElement와 endElement 및 charactersSet 및 다른 태그와 같은 worknig를 대체하는 DefaultHandler 메서드를 사용하고 있습니다. –

+0

어쨌든 문제가 뭐니? – pskink

답변

0

다른 내용이 있는지 여부와 관계없이 태그에서 속성을 가져와야하는 경우 매개 변수의 값으로 호출되는 DefaultHandlerstartElement 메서드를 재정의 할 수 있습니다.

이 매개 변수에서 특정 특성 이름 값을 가져 오려면 AttributesgetValue 메서드를 사용하십시오.

속성을 구문 분석하는 예제는 getValue 메서드를 실제로 사용하지는 않지만 my answer to this related question을 참조하십시오.

관련 문제