XMLtester.asp
<%@LANGUAGE="VBSCRIPT"%>
<%
Dim xrkb, xml_input, xml_output, return_ok
Dim xml_name, xml_version, xml_expenses, xml_claims
Dim parser, root, output_section, c, cc
Dim fso, ts_in, ts_out
Const ForReading = 1
Const ForWriting = 2
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set ts_in = fso.OpenTextFile("C:\Inetpub\wwwroot\input.xml", ForReading)
xml_input = ts_in.ReadAll
ts_in.Close
Set ts_in = Nothing
Set fso = Nothing
Set xrkb = Server.CreateObject("XpertRule.Server2k")
xml_output = xrkb.GoXML(xml_input)
Set xrkb = Nothing
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts_out = fso.OpenTextFile("C:\Inetpub\wwwroot\output.xml", ForWriting, True)
xml_input = ts_out.Write(xml_output)
ts_out.Close
Set ts_out = Nothing
Set fso = Nothing
Set parser = Server.CreateObject("MSXML.DOMDocument")
parser.async = False
return_ok = parser.LoadXML(xml_output)
If return_ok = True Then
Set root = parser.documentElement
For c = 1 To root.childnodes.length
If root.childnodes.Item(c - 1).nodename = "APPLICATION" Then
xml_name = root.childnodes.Item(c - 1).Attributes.GetNamedItem("NAME").Text
End If
If root.childnodes.Item(c - 1).nodename = "OUTPUTS" Then
Set output_section = root.childnodes.Item(c - 1)
For cc = 1 To output_section.childnodes.length
If output_section.childnodes.Item(cc - 1).nodename = "ITEM" Then
If output_section.childnodes.Item(cc -1).Attributes.GetNamedItem("NAME").Text = "Expenses" Then
xml_expenses = output_section.childnodes.Item(cc - 1).Attributes.GetNamedItem("VALUE").Text
End If
If output_section.childnodes.Item(cc - 1).Attributes.GetNamedItem("NAME").Text = "Claims" Then
xml_claims = output_section.childnodes.Item(cc - 1).Attributes.GetNamedItem("VALUE").Text
End If
End If
Next
End If
Next
End If
Set parser = Nothing
%>
<html>
<head>
<title>XMLtester</title>
</head>
<body>
XMLtester results: <%Response.Write(xml_expenses & ", " & xml_claims & ", " & xml_name)%>
</body>
</html>