LISTING 2: Code That Uses a DOM and XPath to Detect Errors Dim xmlhttp, xmldoc set xmlhttp = CreateObject("Msxml2.XMLHTTP.3.0") xmlhttp.Open "GET", "http://localhost/November/template/badquery.xml",false xmlhttp.Send() set xmldoc = xmlhttp.responseXML ' Set XPath as the language for selection (the default is XQL). xmldoc.setProperty "SelectionLanguage", "XPath" ' XPath selects only MSSQLError PIs. set nl = xmldoc.selectNodes("descendant-or-self::processing-instruction('MSSQLError')") for each node in nl msgbox node.target & ":" & node.nodeValue next