On Error Resume Next '' 捕获transformNode方法的错误
FormatXml = objXml.transformNode(objXsl)
If objXsl.parseError.errorCode <> 0 Then
Response.Write "<br><hr>"
Response.Write "Error Code: " & objXsl.parseError.errorCode
Response.Write "<br>Error Reason: " & objXsl.parseError.reason
Response.Write "<br>Error Line: " & objXsl.parseError.line
FormatXml = "<span class=""alert"">格式化XML文件错误!</span>"
End If
Else
Response.Write "<br><hr>"
Response.Write "Error Code: " & objXsl.parseError.errorCode
Response.Write "<br>Error Reason: " & objXsl.parseError.reason
Response.Write "<br>Error Line: " & objXsl.parseError.line
FormatXml = "<span class=""alert"">装载XSL文件错误!</span>"
End If
Else
Response.Write "<br><hr>"
Response.Write "Error Code: " & objXml.parseError.errorCode
Response.Write "<br>Error Reason: " & objXml.parseError.reason
Response.Write "<br>Error Line: " & objXml.parseError.line
FormatXml = "<span class=""alert"">装载XML文件错误!</span>"
End If
Set objXsl = Nothing
Set objXml = Nothing
End Function