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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

incorporate XML to ASP?????

Status
Not open for further replies.

sodax

Programmer
Jun 26, 2003
87
GB
I want to know if there is possible to get XML tags from another server in order to incorporate in my website that does not use XSL. it is possible to get XML values through ASP and change it later with my own style sheet?

 
>> I want to know if there is possible to get XML tags from another server

Assuming you mean "XML Document from another server". Yes it's possible. Have you ever heard of Web Services?

-pete
 
I'm having the same problem. I have an XML document on another server, that I want my website to be able to get values from. How can I do this through ASP and not XSL? I only have read access to the XML document, so hopefully this answer doesn't involve editing the XML document directly. Thank you.
 
You don't have to edit the xml file, your asp page must read the file and then parse it as xml.
 
Found the solution!

You have to use the XMLHTTP property to get the raw data from the XML file that is located on an external server. Then, the Call xmlhttp.send brings back the information that you can then parse and look for information. This example found an external XML file and printed one value from it.

<%
Dim xmlhttp
'create object to retrieve XML via HTTP
Set xmlhttp = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
xmlhttp.Open &quot;GET&quot;, &quot; false
Call xmlhttp.send

Dim xml

Set xml = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)

xml.loadxml(xmlhttp.responseText)


dim price
'find the node that we want and put it's value in a variable
price = xml.getElementsByTagName(&quot;Symbol/@Last&quot;).item(0).text
response.Write(&quot;Company's current price is: &quot; & price)

Set xmlhttp = Nothing
Set xml = Nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top