Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Feed

Status
Not open for further replies.

softwareguy2

Technical User
Apr 2, 2002
11
0
0
US
I am trying to pull an XML feed from a remote server, and then transforming it with an XSL stylesheet. For some reason if i run it with the stylesheet on the local server, it works fine, but I can not get it to obey the stylesheet when i am on the remote server.
Here is the code i am using.

<%
Response.Buffer = True
Dim objXMLhttp, xml

' Create an xmlhttp object:
Set objXMLhttp = Server.CreateObject(&quot;Microsoft.XMLhttp&quot;)
Set xml = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)


' Opens the connection to the remote server.
objXMLhttp.Open &quot;GET&quot;, &quot; False

' Actually Sends the request and returns the data:
objXMLhttp.Send

xml.loadXML(objXMLhttp.responseText)
set xsl = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
xsl.async = false
xsl.load(Server.MapPath(&quot;xml_feed.xsl&quot;))

Response.Write xml.xml
%>

any suggestions are greatly appreciated
thanks in advance
 
Code:
objXMLhttp.Open &quot;GET&quot;, &quot;[URL unfurl="true"]http://xmlfeed.xml&quot;;,[/URL] False

I don't think that is a valid URL

-pete
 
hi,

Whether you have stored XSL stylesheet in the remote server?
 
You haven't actually utilized the xsl stylesheet. All you've done is load it into an object variable. Rather than Response.Write xml.xml, try Response.Write xml.TransformNode(xsl). Also, if your GET request is returning an xml document, you may need to use the responseXML property rather than responseText in your loadXML method call.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top