日期:2014-05-17  浏览次数:20785 次

请给看看,下面有错误吗?
dim doc,nd,ndfd
set doc=CreateObject("Microsoft.XMLDOM")
doc.load("vb.xml")
set nd=doc.documentElement
set ndfd=nd.selectNodes("field")

最后一句提示有错,请给指点下。再有我的服务器是windows 2003,同时开启了asp和asp.net,是不是有影响?

------解决方案--------------------
VBScript code

<%
Set oDoc = CreateObject("Msxml2.DOMDocument")
With oDoc
    .async              = False
    .validateOnParse    = False
    .preserveWhiteSpace = False
    .resolveExternals   = False
    .load Server.MapPath("vb.xml")
    If .parseError.errorCode <> 0 Then
        sErrMsg     = .parseError.errorCode & "|" &_
                      .parseError.srcText & "|" & .parseError.reason
        Response.Write sErrMsg
        Response.End
    End If
End With
Set ndfd = oDoc.selectNodes("//field")
Response.Write ndfd.length
Set oDoc = Nothing
%>