<% Option Explicit %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Categories listing</title>
</head>
<body>
<!-- #include file=AjaxLibrary.asp -->
<%
Dim QID : QID = Request("question")
If QID = 2 Then Response.Status = "500 Question failed" : Response.End
Dim QRS : Set QRS = DB.Execute("Select * From QA Where QuestionId = " & QID)
Dim XSL : XSL = "answer.xsl" : If Request("mode") = "ajax" Then XSL = "answer_ajax.xsl"
If QRS.EOF Then PrintError "No such question# " & QID
Dim QNode : Set QNode = NewXMLObject("QA")
With QNode.documentElement
.setAttribute "id",QRS("QuestionId").Value
.setAttribute "category",QRS("Category").Value
End With
InsertHTMLFragment NewXMLElement(QNode,"Question",Null),QRS("Question").value
InsertHTMLFragment NewXMLElement(QNode,"Answer",Null),QRS("Answer").value
OutputXMLResponse QNode,XSL
%>
</body>
</html>