Jump to content

Namespace Issue


jeffdegarmo

Recommended Posts

I have a styleshee that displays XML data properly if I use <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> . I know this isn't the right one to use. However, when I use <xsl:stylesheet 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 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>

** XML Retrieval Code **

Dim objXMLDim objXSLDim strHTML'Load the XML FileSet objXML = Server.CreateObject("Microsoft.XMLDOM")objXML.async = FalseobjXML.setProperty "ServerHTTPRequest", trueobjXML.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 thenstrHTML="XML Load error: " & objXSL.parseError.errorcodeelse'Load the XSL FileSet objXSL = Server.CreateObject("Microsoft.XMLDOM")objXSL.async = FalseobjXSL.setProperty "ServerHTTPRequest", true'objXSL.validateOnParse=falseobjXSL.load(Server.MapPath("memberstest.xsl"))if objXSL.parseError.errorcode<>0 thenstrHTML="XSL Load: Reason - " & objXSL.parseError.reason & "Line - " & objXSL.parseError.line & "Line Pos - " & objXSL.parseError.linePoselse' Transform the XML file using the XSL stylesheetstrHTML = objXML.transformNode(objXSL)Set objXML = NothingSet objXSL = Nothingend ifend ifResponse.Write("strHTML: " & strHTML)

Link to comment
Share on other sites

Have you tryed removing the namespace for "diffgr" in the XSLT and declare it only in the XML?Do other XML&XSLT pairs work with this "XML retreival" code (though if I understand correctly, this is your XSLT processor)?

Link to comment
Share on other sites

Have you tryed removing the namespace for "diffgr" in the XSLT and declare it only in the XML?Do other XML&XSLT pairs work with this "XML retreival" code (though if I understand correctly, this is your XSLT processor)?
Unfortunately, I'm using an XML feed from a third-party. After much trouble-shooting, I figured out that the third-party XML feed declared a namespace (xmlns=http://www.sbainc.net/products/sbawebservice) that did not exist. The link went to a Page Cannont Be Found page. Apparently, this adversely affected the XSL file that I had created. Once I got them to remove that declaration everything worked fine.Thanks for the response.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...