Solved

XML Get Node value

Posted on 2013-06-13
4
504 Views
Last Modified: 2013-06-13
I have vb code that's reading XML

Dim XmlDoc As New XmlDocument()
XmlDoc.LoadXml(myXmlData)

How would I find this particular node's value (null)  using VB Code?
I THINK I need a NameSpaceManager but don;t know how to go about this.

<csta:localConnectionInfo>null</csta:localConnectionInfo>
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
  • 3
4 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39245377
Basically u use System.Xml.XmlNamespaceManager xmlnsManager = new System.Xml.XmlNamespaceManager(xmldoc.NameTable);
xmlnsManager.AddNamespace("csta", "...");

But i need to see the namespace declared in the xml. Can u post it?
0
 

Author Comment

by:lrbrister
ID: 39245454
Sedgwick
Will post in an hour
0
 

Author Comment

by:lrbrister
ID: 39245606
Sedgewick,
  Here is the full XML
Only the phone numbers are ### out

remember...I'm trying to get
<csta:localConnectionInfo>null</csta:localConnectionInfo>

<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:ServiceInitiatedEvent>
      <csta:monitorCrossRefID>149</csta:monitorCrossRefID>
      <csta:initiatedConnection>
        <csta:callID>1007400000023952633</csta:callID>
        <csta:deviceID>##########.70269674</csta:deviceID>
      </csta:initiatedConnection>
      <csta:initiatingDevice>
        <csta:deviceIdentifier>##########</csta:deviceIdentifier>
      </csta:initiatingDevice>
      <csta:calledDevice>
        <csta:deviceIdentifier>##########</csta:deviceIdentifier>
      </csta:calledDevice>
      <csta:localConnectionInfo>initiated</csta:localConnectionInfo>
      <csta:cause>normal</csta:cause>
      <csta:extensions>
        <csta:privateData>
          <csta:private>
            <m5:deviceSpecifiers>
              <m5:endpoint>001BD5851263</m5:endpoint>
              <m5:line>1</m5:line>
            </m5:deviceSpecifiers>
            <m5:phoneUIDisplay>
              <csta:callerId />
              <csta:extraDisplay />
            </m5:phoneUIDisplay>
          </csta:private>
        </csta:privateData>
      </csta:extensions>
    </csta:ServiceInitiatedEvent>
  </Result>
</org.m5.api.v1.Response>

Open in new window

0
 

Author Closing Comment

by:lrbrister
ID: 39245761
After I spent some time in though I used your solution and this is the working set

Dim namespaceManager As New XmlNamespaceManager(XmlDoc.NameTable)
namespaceManager.AddNamespace("csta", "http://www.ecma-international.org/standards/ecma-323/csta/ed5")
Dim ddd = XmlDoc.SelectSingleNode("//csta:localConnectionInfo", namespaceManager)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

717 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