Solved

What type of XML Node is this?

Posted on 2013-06-04
4
282 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

635 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