I have a styleshee that displays XML data properly if I use <xsl:styleshe et xmlns:xsl="http ://www.w3.org/TR/WD-xsl"> . I know this isn't the right one to use. However, when I use <xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"> the page does not display any of the XML data. It's as if it hasn't even pulled in the data.
** XSL Code **
** XML Retrieval Code **
** XSL Code **
Code:
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> <xsl:template match="/"> <table><tr><td>test me</td></tr></table> <xsl:for-each select="DataSet/diffgr:diffgram/MPDataSet/Record"> <xsl:value-of select="id"/><br /> </xsl:for-each> <table><tr><td>test me 2</td></tr></table> </xsl:template> </xsl:stylesheet>
Code:
Dim objXML
Dim objXSL
Dim strHTML
'Load the XML File
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", true
objXML.load("http://mail.sbainc.net:8800/sbawebservice.asmx/BusinessSearch?strAllAnyExact=" & request("strAllAnyExact") & "&strSearchType=" & request("strSearchType") & "&intPageNum=" & request("intPageNum") & "&intItemsPerPage=" & request("intItemsPerPage") & "&strKeywords=" & request("strKeywords") & "&strKWWhere=" & request("strKWWhere") & "&strBusinessStatus=" & request("strBusinessStatus") & "")
if objXML.parseError.errorcode<>0 then
strHTML="XML Load error: " & objXSL.parseError.errorcode
else
'Load the XSL File
Set objXSL = Server.CreateObject("Microsoft.XMLDOM")
objXSL.async = False
objXSL.setProperty "ServerHTTPRequest", true
'objXSL.validateOnParse=false
objXSL.load(Server.MapPath("memberstest.xsl"))
if objXSL.parseError.errorcode<>0 then
strHTML="XSL Load: Reason - " & objXSL.parseError.reason & "Line - " & objXSL.parseError.line & "Line Pos - " & objXSL.parseError.linePos
else
' Transform the XML file using the XSL stylesheet
strHTML = objXML.transformNode(objXSL)
Set objXML = Nothing
Set objXSL = Nothing
end if
end if
Response.Write("strHTML: " & strHTML)