<% '----------------------------------------------- ----------------- 'Program Description: Complete the increase, delete, modification of the specified node text in the XML document to the XML document: No' export parameters: no ' ---------------------------------------------- 'functions Name: ConnectXML () 'Entry Parameters: FileName XML File Name' Exit Parameters: No 'Return Value: ConnectXML = 0, XMLMorntekDocument is an object that successfully loads an XML document.
'ConnectXML <> 0, print error message strrror' ------------------------------------ ---------- 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 = "
error" & XMLMorntekDocument.parseerror.errorcode & " h2>" strError = strError & XMLMorntekDocument.parseerror.reason & "
" strError = strError & XMLMorntekDocument.parseerror.url & "
" strError = strError & XMLMorntekDocument.parseerror.line & "
" strError = strError & XMLMorntekDocument.parseerror.filepos & "
" strError = strError & XMLMorntekDocument.parseerror.srcText & "
" response.write STRERROR END IF END FUNCTION '-------------------------------------------- ---- 'Function Name: CloseXml ()' Entry Parameters: No 'Export Parameters: No' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------- Function Closexml (XMLMorntekDocument) IF Isobject (XMLMorntekDocument) THEN SET XMLMORNTEKDOCUMENT = Nothing end if End function '----------------------------------------------------------------------------- ----------------- 'function name: selectxmlNodeText (ElementName)' 入口 Parameters: ElementName Elements' Name 'Exit Parameters: No' ----------- ------------------------------------- Function SelectXmlNodeText (ElementName) ElementName = "//" & ElementName Temp = Xmlmorntekdocument.selectsinglenode (elementname) .text selectXMLNODETEXT =