This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Document doc = XMLParser.parse(result);//resultにXMLデータが入っている | |
NodeList itemList = doc.getElementsByTagName("Item"); | |
int num = itemList.getLength(); | |
for (int i = 0; i < num; i++) { | |
Element node = (Element) itemList.item(i); | |
//タイトルの入手 | |
Node titleNode = node.getElementsByTagName("Title").item(0); | |
titleName = titleNode.getFirstChild().getNodeValue(); | |
//Window.alert("title入手"); | |
//著者の入手 ここはAuthorかCreator | |
if (0 < node.getElementsByTagName("Author").getLength()) { | |
authorName = node.getElementsByTagName("Author").item(0).getFirstChild().getNodeValue(); | |
} else if (0 < node.getElementsByTagName("Creator").getLength()) { | |
authorName = node.getElementsByTagName("Creator").item(0).getFirstChild().getNodeValue(); | |
} else { | |
authorName ="<著者情報なし>"; | |
} | |
//出版社の入手 | |
Node publisherNode = node.getElementsByTagName("Publisher").item(0); | |
publisherName = publisherNode.getFirstChild().getNodeValue(); | |
} |