I am having trouble converting an XML file via XSL stylesheets when it is being pulled from a different server. I am certain that I have a working XSL file as I have tested it locally and by manually placing the XML file onto my server. The code that works is:
Code:
<%@ LANGUAGE=JScript %>
<%
var sourceFile = Server.MapPath("news.xml");
var styleFile = Server.MapPath("news.xsl");
var source = Server.CreateObject("MSXML2.DOMDocument");
var style = Server.CreateObject("MSXML2.DOMDocument");
source.async = false;
source.resolveExternals = false;
source.load(sourceFile);
style.async = false;
style.resolveExternals = false;
style.load(styleFile);
Response.Write(source.transformNode(style));
%>
When I attempt to directly pull the XML file from a different site it does not work at all. Here is the code that will not work (using the same XSL file):
Code:
<%@ LANGUAGE=JScript %>
<%
var xmlHTTP = Server.CreateObject("MSXML2.serverxmlhttp");
xmlHTTP.open("GET", "http://www.gamespot.com/misc/rss/gamespot_updates_playstation_2.xml", false);
xmlHTTP.send;
var styleFile = Server.MapPath("news.xsl");
var source = Server.CreateObject("MSXML2.DOMDocument");
var style = Server.CreateObject("MSXML2.DOMDocument");
source.async = false;
source.resolveExternals = false;
source.loadXML(xmlHTTP.ResponseText);
style.async = false;
style.resolveExternals = false;
style.load(styleFile);
Response.Write(source.transformNode(style));
%>
Any help is greatly appreciated! Thanks!!