<%
Dim objXSLT : Set objXSLT = Server.CreateObject("Msxml2.DOMDocument.6.0")
objXSLT.ASync = False
objXSLT.setProperty "SelectionLanguage","XPath"
If Not objXSLT.Load(Server.MapPath("/Q26420449/sort.xsl")) Then
Response.Write "Error loading XSLT: " & objXSLT.parseError.reason
Response.End
End If
Dim objXML : Set objXML = Server.CreateObject("Msxml2.DOMDocument.6.0")
objXML.ASync = False
objXML.setProperty "SelectionLanguage","XPath"
If Not objXML.Load(Server.MapPath("/Q26420449/src.xml")) Then
Response.Write "Error loading XML: " & objXML.parseError.reason
Response.End
End If
strSortedXML = objXML.transformNode(objXSLT)
If Not objXML.LoadXML(strSortedXML) Then
Response.Write "Error loading XML: " & objXML.parseError.reason
Response.End
End If
Dim dictCats : Set dictCats = Server.CreateObject("Scripting.Dictionary")
Set objResults = objXML.selectNodes("//row[hide!='true']")
If objResults.length > 0 Then
Dim objNode, objSubNode, strCurrentCat, intCatCount
strCurrentCat = ""
intCatCount = 0
Do
Set objNode = objResults.nextNode()
If objNode Is Nothing Then Exit Do
Set objSubNode = objNode.selectSingleNode("category")
If Not objSubNode Is Nothing Then
If Not strCurrentCat = LCase(objSubNode.text) Then
intCatCount = 0
strCurrentCat = LCase(objSubNode.text)
Response.Write "<h2>" & strCurrentCat & "</h2>"
End If
intCatCount = intCatCount + 1
If intCatCount < 4 Then
strNodeName = "pname" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "psubname" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "lprice1" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "lprice2" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "lprice3" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "mprice1" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "mprice2" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "mprice3" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "sprice1" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "sprice2" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
strNodeName = "sprice3" : Response.Write strNodeName & ": " & getNodeValue(objNode.selectSingleNode(strNodeName)) & "<br />"
Response.Write "<hr />"
End If
End If
Loop
End If
Function getNodeValue(objNode)
If Not objNode Is Nothing Then
getNodeValue=objNode.text
Else
getNodeValue=""
End if
End Function
Response.Write TypeName(objResults)
Set objResults = Nothing
Set objXML = Nothing
%>
|