Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6882399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:14:54+00:00 2026-05-27T05:14:54+00:00

My Classic ASP code connects to a URL and displays XML, my code looks

  • 0

My Classic ASP code connects to a URL and displays XML, my code looks like below

Response.ContentType = "text/xml"

myRSSfile = "http://abc.com"

Set getPage = Server.CreateObject("Microsoft.XMLHTTP" )

getPage.Open "GET", myRSSfile, false
getPage.SetRequestHeader "Content-type", "text/xml"
getPage.Send

Response.Write(getPage.responseText)
'response.write getPage.Status

Set getPage = Nothing

XML as follows

<userContent xmlns="http://www.abc.com/userContent" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abc.com/abc.xsd">
<questions>
<question>
<item>
<sku>SCG20056-006</sku>
<title>Test me machine</title>
</item>
<text>
We are replacing a built in machine how it would be ?
</text>
<dateTime>2011-11-10T22:43:02Z</dateTime>
<answer>
<user>
<firstName>Raj</firstName>
<lastName>lastname</lastName>
</user>
<text>
We have been very happpy with the replacement
</text>
<dateTime>2011-11-21T21:00:24Z</dateTime>
</answer>
<answer>
<user>
<firstName>john</firstName>
<lastName>wright</lastName>
</user>
<text>
not so happy
</text>
<dateTime>2011-11-21T21:00:24Z</dateTime>
</answer>
</question>
</questions>
<comments/>
</userContent>

What i need to do is display
1) “questions/question/text” Tag
2) Display all the answers to that question that is this tag
“questions/question/answer/user/firstName” Tag
&
3) “questions/question/answer/text” Tag
Is it possible to do in Classic ASP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:14:54+00:00Added an answer on May 27, 2026 at 5:14 am

    The approach to take with this is to use XSL to perform a transform on the received XML to generate the HTML you would like to display. Here is a sample to get you started:

    <?xml version="1.0" encoding="utf-8"?>
    
    <xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:uc="http://www.abc.com/userContent" exclude-result-prefixes="uc">
    
      <xsl:output method="html" />
    
      <xsl:template match="/uc:userContent">
        <div class="container">
          <xsl:apply-templates select="uc:questions/uc:question" />
        </div>
      </xsl:template>
    
      <xsl:template match="uc:question">
        <b>Shopper asked:</b> <xsl:value-of select="uc:text" />
        <ul>
          <xsl:apply-templates select="uc:answer" />
        </ul>
      </xsl:template>
    
      <xsl:template match="uc:answer">
        <li>
          <b>
            <xsl:value-of select="uc:user/uc:firstName" />
            <xsl:text> </xsl:text>
            <xsl:value-of select="uc:user/uc:lastName" />:
          </b>
          <xsl:value-of select="uc:text" />
        </li>
      </xsl:template>
    
    </xsl:stylesheet>
    

    You would place this xsl in a file called for example “userContent.xsl” somewhere in you web site, for ease of example we’ll put it in the root.

    Now we need to tidy your code:

    <%
    Option Explicit 
    Dim myRSSFile: myRSSfile = "http://abc.com"     
    
    Dim getPage: Set getPage = Server.CreateObject("MSXML2.XMLHTTPServer.3.0" )     
    
    getPage.Open "GET", myRSSfile, false        
    getPage.Send     
    
    Dim dom : dom = getPage.responseXml     
    Dim xsl : Set xsl = CreateObject("MSXML2.DOMDocument.3.0")
    
    xsl.async = false
    xsl.load Server.MapPath("/userContent.xsl")
    
    %>
    <html>
       <head>
           <title>Some Content</title>
       </head>
       <body>
         <%
             Response.Write dom.TransformNode(xsl)
         %>
       </body>
    </html>
    

    Notes:

    • Don’t use XMLHTTP in ASP it isn’t designed to be used in a Server.
    • There is no need to send a content type header in xml http request when you aren’t sending any content.
    • When you want to manipulate XML received use the responseXml property which gives you a loaded XML Document to play with rather than the responseText. (Certainly don’t use RegEx to do it).
    • Always include Option Explicit in your scripts it will save you bags of time hunting bugs.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NET and VB.net code behind. I have a classic ASP page that connects to
below is my ASP classic code.i having a problem when put if else statement
I have the following shortened classic ASP code that makes a SQL insert call...
I've finally found a way to debug classic asp code in visual studio 2008
Is it possible to step though Classic ASP VB code without Visual interdev or
We have a large ASP classic code base but I'm looking to do future
What should i use to code Classic ASP under Linux. I have really tried
Is there a way to enable code outlining for Classic ASP in Visual Studio
If I have the following jscript code on a classic asp page, how do
i need ur help regarding web services in classic asp here is my code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.