XML DOM name ÊôÐÔ
¶¨ÒåºÍÓ÷¨
name ÊôÐÔ·µ»ØÊôÐÔµÄÃû³Æ¡£
Óï·¨£º
attrObject.name
ʵÀý
ÔÚËùÓеÄÀý×ÓÖУ¬ÎÒÃǽ«Ê¹Óà XML Îļþ books.xml£¬ÒÔ¼° JavaScript º¯Êý loadXMLDoc()¡£
ÏÂÃæµÄ´úÂëÆ¬¶ÎÏÔʾ category ÊôÐÔµÄÃû³ÆºÍÖµ£º
xmlDoc=loadXMLDoc("/example/xdom/books.xml");
var x=xmlDoc.getElementsByTagName('book');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].name
);
document.write(" = ");
document.write(x.item(i).attributes[0].value);
document.write("<br />");
}
ÒÔÉÏ´úÂëµÄÊä³ö£º
category = children category = cooking category = web category = web