set objDom = server.CreateObject("MicroSoft.XMLDom") objDom.load(Server.MapPath("test.xml")) Set objNode = objDom.documentElement '节点长度 newint=objNode.ChildNodes.length-1 for i=0 To newint '节点id属性 set objarr=objNode.ChildNodes.item(i) if ( objarr.Attributes.item(1).Text = channelid) then if( objarr.ChildNodes.item(0).Attributes.item(1).Text = sfield ) then '直接定位到节点的ID下属性的内容 objDom.getElementsByTagName("channel").item(i).childNodes.item(0).Attributes.item(2).Text = num exit for end if end if set objarr = Nothing next objDom.save(Server.MapPath("test.xml")) set objNode = Nothing Set objDom = Nothing %>