XML getting and parsing

I need something to read a XML string and grab attributes from it in
The source of the XML is a local script, but the script need to be executed:

As you'll notice the XML source is also classic asp, not .net so this is the only realy way i can do this.

There is also only one element per xml request, so there's no need to throw any of this into a datagrid

a sample of the XML would be something like: <element><attrib1>pie</attrib1><attrib2>chocolate</attrib2><element>

so yeah, i want attrib1 and attrib2...
LVL 16
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

OliWarnerAuthor Commented:
at the moment my code looks a little like this:

            dim webC As New System.Net.WebClient()
            Dim orgn As String = ""
            Dim ispn As String = ""
            Dim ispd As String = ""
            Dim ispc As String = ""

            Dim remoteUrl as String = "" + ip
                  Dim myDatabuffer As Byte() = webC.DownloadData(remoteUrl)
                  Dim download as String = Encoding.ASCII.GetString(myDataBuffer)

apart from the connection to the web-page cant be established to download it... its quite odd...
Why can't use xmlHTTP to do it....

See this

OliWarnerAuthor Commented:
Dim strXML As String"POST", strUrl)
strXML = xmlHTTP.ResponseText()
ProcessData = strXML

ok, but how do i requests the elemnts from the XML?
I've no exp with XML and and i'm not looking to get too bogged down in something that I could as easily build my own parser...
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Here is a simple working example for you

<%@ Page language="c#"  %>
<%@ Import Namespace="System.Xml" %>
<script language="C#" runat="server">
private void Page_Load(object sender, System.EventArgs e)
 Response.Write( ReadXML("") );
public string ReadXML(string UrlToXmlFile)
 // this string will concatenate all the xml values
 System.Text.StringBuilder sbXML = new System.Text.StringBuilder();
 XmlTextReader reader = null;
  // load the file from the URL
  reader = new XmlTextReader(UrlToXmlFile);
  object oProvinceName = reader.NameTable.Add("Province");
  while (reader.Read())
   if (reader.NodeType == XmlNodeType.Element)
    if (reader.Name.Equals(oProvinceName))
     sbXML.Append(reader.ReadString()).Append("<br />");
  return sbXML.ToString();
 catch(Exception e)
  return "";
  if (reader!=null)
  <title> - ASP.NET : XmlTextReader</title>
  <form runat="server" ID="Form1">

  <?xml version="1.0" encoding="utf-8" ?>
- <Canada>
  <Province>British Columbia</Province>
  <Province>New Brunswick</Province>
  <Province>Newfoundland and Labrador</Province>
  <Province>Northwest Territories</Province>
  <Province>Novia Scotia</Province>
  <Province city="Toronto">Ontario</Province>
  <Province>Prince Edward Island</Province>



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OliWarnerAuthor Commented:
right , sameish error as before:

System.Net.WebException: The underlying connection was closed: Unable to connect to the remote server.

Basically I'm requesting a page which is on the same server but is dynamic and also in another language so it has to be connected through the server's output...

I'm not sure hot to get around this...
this may be problem with the proxy settings..

Is  ur client is behind a proxy ?

Check tools-->connections-->Internet options-->Lan settings
-->bypass proxy server for local addresses

Is it checked?

and give absolute path to xml file or asp file

OliWarnerAuthor Commented:
that wouldnt let the asp page execte would it?
and no, normal webclients to other servers work fine
OliWarnerAuthor Commented:
Well it would be answered but it doesnt quite work.
There's something fishy going on with requesting things from localhost... it couldnt be to do with nternal portforwarding at my host, but just incase somebody else reads this the answer is mildly incomplete if you get the same problem...

Anyway, ty for the help guys.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.