|
<% '---------------------------------------------------------------- '程序简介: 完成asp语言对XML文档中指定节点文本的增加、删除、修改、查看 '入口参数: 无 '出口参数: 无 '------------------------------------------------ '函数名字:ConnectXml() '入口参数: filename 需要连接或打开的xml文件名 '出口参数: 无 '返回值 :ConnectXml=0,XMLMorntekDocument就是一个成功装载XML文档的对象了。 ' ConnectXml<>0,则打印错误信息strError '------------------------------------------------ dim XMLMorntekDocument
function ConnectXml(filename) dim strSourceFile strSourceFile = Server.MapPath(filename) Set XMLMorntekDocument = Server.CreateObject("Microsoft.XMLDOM") XMLMorntekDocument.async = false XMLMorntekDocument.load(strSourceFile) ConnectXml=XMLMorntekDocument.parseerror.errorcode if XMLMorntekDocument.parseerror.errorcode<>0 then strError="<h2>error"&XMLMorntekDocument.parseerror.errorcode&"</h2>" strError=strError&XMLMorntekDocument.parseerror.reason&"<br>" strError=strError&XMLMorntekDocument.parseerror.url&"<br>" strError=strError&XMLMorntekDocument.parseerror.line&"<br>" strError=strError&XMLMorntekDocument.parseerror.filepos&"<br>" strError=strError&XMLMorntekDocument.parseerror.srcText&"<br>" response.write strError end if end function
'------------------------------------------------ '函数名字:CloseXml() '入口参数: 无 '出口参数: 无 '------------------------------------------------ function CloseXml(XMLMorntekDocument) if IsObject(XMLMorntekDocument) then set XMLMorntekDocument=nothing end if end function
'------------------------------------------------ '函数名字:SelectXmlNod
[1] [2] [3] 下一页 |