<% function getXml(xmlPath) dim xmlDoc dim isValid set xmlDoc = server.createObject("Microsoft.XMLDOM") xmlDoc.async = false xmlDoc.load server.mapPath(xmlPath) isValid = cBool(xmlDoc.parseError.errorCode = 0) if not isValid then response.write getXMLError(xmlDoc) end if set getXml = xmlDoc end function function getXmlString(xmlString) dim xmlDoc dim isValid set xmlDoc = server.createObject("Microsoft.XMLDOM") xmlDoc.async = false xmlDoc.loadXML xmlString isValid = cBool(xmlDoc.parseError.errorCode = 0) if not isValid then sendError getXMLError(xmlDoc) end if set getXmlString = xmlDoc end function function getXMLError(xmlDoc) dim strError strError = "Invalid XML file!" & vbNewline & _ "File: " & xmlDoc.parseError.url & vbNewline & _ "Line: " & xmlDoc.parseError.line & vbNewline & _ "Character: " & xmlDoc.parseError.linepos & vbNewline & _ "Source Text: " & xmlDoc.parseError.srcText & vbNewline & _ "Description: " & xmlDoc.parseError.reason getXMLError = strError end function %>