Solved

What type of XML Node is this?

Posted on 2013-06-04
4
281 Views
Last Modified: 2013-06-05
I am getting the xml below returned from an HttpWebRequest
I want to ALWAYS read the first node below the <Result..." line.

How can I do that in VB?
In otherwords my variable would be

myVar = "MonitorStartResponse"


Screenprint
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39219615
Can you post the code you are attempting to use? I suspect you are probably having an issue with namespaces and prefixes.

You might also try using the FirstChild property against the XmlElement you have populated with the <Result> node.
0
 

Author Comment

by:lrbrister
ID: 39219658
kaufmed
I'm strying to get the first "Child" after the <Resul..." middle section.

It could be the csta:MonitorStartResponse
It could be csta:EstablishedEvent
It could be anything
But it will always be the very first one.

Here's the actual XML.

<org.m5.api.v1.Response xmlns:m5="http://www.m5net.com/org/m5/data/v2/cti" xmlns:csta="http://www.ecma-international.org/standards/ecma-323/csta/ed5">
  <ErrorCount>0</ErrorCount>
  <Id>1</Id>
  <Result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="org.m5.data.v2.cti.HostedConnectObject">
    csta:MonitorStartResponse>
      <csta:monitorCrossRefID>392</csta:monitorCrossRefID>
    </csta:MonitorStartResponse>
  </Result>
</org.m5.api.v1.Response>

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39220800
As I mentioned...

Module Module1

    Sub Main()
        Dim xdoc As New Xml.XmlDocument()

        xdoc.Load("input.xml")

        Dim firstChildOfResult As Xml.XmlElement = xdoc.SelectSingleNode("//Result").FirstChild
    End Sub

End Module

Open in new window

0
 

Author Closing Comment

by:lrbrister
ID: 39223011
Thanks
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question