1
그래서, 내가 쓴 무언가를 얻을 수 있습니다.안드로이드 구문 분석 XML 노드 값을 유튜브 사용자에 대한 피드를 구문 분석 할 작은
문제는 내가 전화 할 때 getNodeValue()
는 null가 돌려 주어집니다. 왜 이런거야? 어떤 아이디어 나 대안이 감사합니다. 감사합니다. 다음 항목의 코드 조각의,의
https://gdata.youtube.com/feeds/api/users/estudiosabiertostv/uploads
: 여기
try {
Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("https://gdata.youtube.com/feeds/api/users/estudiosabiertostv/uploads");
NodeList entries = d.getElementsByTagName("entry");
for(int i = 0; i < entries.getLength(); i++) {
NodeList children = entries.item(i).getChildNodes();
YoutubeVideo video = new YoutubeVideo();
for(int j = 0; j < children.getLength(); j++) {
Node child = children.item(j);
if(child.getNodeName().equals("title")) {
video.title = child.getNodeValue();
break;
}
}
videos.add(video);
}
}
catch (Exception e) {
e.printStackTrace();
}
내가에서 XML을 얻고 URL입니다 : 여기
어떻게 내가 현재하고 있어요 것들의 조각이다 제목을 얻으려는 것입니다.
<entry>
<id>http://gdata.youtube.com/feeds/api/videos/oDbOmTY3gDw</id>
<published>2012-12-17T08:14:12.000Z</published>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/>
<title type="text">SEAS - Grupo San Valero - Crea tu propia Navidad (2012)</title>
<content type="text">Felicitación de Navidad de SEAS, Estudios Abiertos del Grupo San Valero</content>
<link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=oDbOmTY3gDw&feature=youtube_gdata"/>
<author>
<name>estudiosabiertostv</name>
<uri>http://gdata.youtube.com/feeds/api/users/estudiosabiertostv</uri>
</author>
</entry>
내 머리 위로 떨어져, 제목 노드는 다시 아이가 있어야합니다 - 텍스트 노드를, 그 하나는 실제 텍스트를 포함해야합니다. –
@ full.stack.ex 당신에게서 위대한 것들. 답변을 작성하면 받아 들일 것입니다. – conor