public function mMergeXML(tXML_DATA, tXML_FILEPATH, tXML_FILENAME)
Set orgXML = Server.CreateObject("MSXML2.DOMDocument.4.0") orgXML.async = false orgXML.load(tXML_FILEPATH & "\" & tXML_FILENAME) Set OrgNode = orgXML.SelectSingleNode("./package")
Set newXML = Server.CreateObject("MSXML2.DOMDocument.4.0") newXML.async = false newXML.loadXML(tXML_DATA) Set newNode = newXML.SelectSingleNode("./package")
' ** Check og se om ID eksisterer ** on error resume next newID = newXML.SelectSingleNode("package/message/@id").text orgID = orgXML.SelectSingleNode("package/message[@id='"&newID&"']/@id").text response.write "orgID: " & orgID & vbcrlf response.write "newID: " & newID & vbcrlf if err.number <> 0 then 'response.write "err : " & err.description & vbcrlf err.clear IsNothingNode = true else IsNothingNode = false end if on error goto 0
if IsNothingNode = true then for each tmpNode in newNode.childNodes OrgNode.appendChild(tmpNode) next Call orgXML.Save(tXML_FILEPATH & "\" & tXML_FILENAME) else end if
set newNode = nothing set newXML = nothing set OrgNode = nothing set orgXML = nothing
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.