p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP XML (http://p2p.wrox.com/forumdisplay.php?f=69)
-   -   XLST transformNode problem (http://p2p.wrox.com/showthread.php?t=8969)

beyondtron February 4th, 2004 04:52 PM

XLST transformNode problem
 
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!!



All times are GMT -4. The time now is 05:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.