适合十岁儿童看的书籍:懂XML的朋友帮帮我,谢谢

来源:百度文库 编辑:高考问答 时间:2024/05/07 07:37:52
有这样一段代码
<xml id="meetingsXML" src="meetings.xml"></xml>
<script language="javascript">
function readXMLDocument()
{
var xmldoc,meetingsNode,meetingNode,peopleNode,personNode,first_nameNode,last_nameNode,attributes,attendancePerson,outputText
xmldoc=document.all("meetingsXML").XMLDocument
meetingsNode=xmldoc.documentElement
meetingNode=meetingsNode.firstChild
peopleNode=meetingNode.firstChild
personNode=peopleNode.lastChild
first_nameNode=personNode.firstChild
last_nameNode=personNode.lastChild
attributes=personNode.attributes
attendancePerson = attributes.getNamedItem("ATTENDANCE")
outputText=first_nameNode.firstChild.nodeValue+' '+last_nameNode.firstChild.nodeValue+' '+"is"+' '+attendancePerson.value
messageDIV.innerHTML= outputText
}
</script>
当执行此函数时说:
错误:'null'为空或不是对象,请问怎么改,谢谢,提示说错误出在attendancePerson = attributes.getNamedItem("ATTENDANCE")
这一行,谢谢