日期:2014-05-16 浏览次数:20396 次
<IS>
<year time="2014">
<major name="Computer Science">
<class>1401</class>
<class>1402</class>
<class>1403</class>
<class>1404</class>
</major>
<major name="Communication Engineering">
<class>1405</class>
<class>1406</class>
<class>1407</class>
<class>1408</class>
</major>
</year>
<year time="2013">
<major name="Computer Science">
<class>1301</class>
<class>1302</class>
<class>1303</class>
<class>1304</class>
</major>
<major name="Communication Engineering">
<class>1305</class>
<class>1306</class>
<class>1307</class>
<class>1308</class>
</major>
</year>
</IS>
for(i in xml.getElementByTagName('year')) {
for(j in xml[i].getElementByTagName('major')) {
.....
}
}