スクリプトの記述

前回に引き続き記述します。

function XMLLoaded(success){
rootNode = indexXML.firstChild;
xmlIndex.blogTitle = rootNode.attributes["blogTitle"];
xmlIndex.blogDescription = rootNode.attributes["blogDescription"];
xmlIndex.blogURL = rootNode.attributes["blogURL"];

解説
firstChild:最初の子ノードを参照する
□.attributes:ノードのすべての属性を格納したObjectインスタンス
ノードXMLインスタンスを_rootとし、その下にXMLの文章などの階層構造が展開される。ツリー構造の節の部分をノードという。