Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

SelectSingleNode Not showing correct data

$
0
0

Hi, 

Whenever we are using "docNode.SelectSingleNode("//im_doc_id").InnerText" it is returning same node value whereas when we are using docNode.SelectSingleNode("im_doc_id").InnerText it is returning correct values.

Same code was earlier file earlier. 

here is the code

Dim xmlDoc As New XmlDocument

        xmlDoc.Load("D:\import.xml")

        Dim docNodes As XmlNodeList
        Dim strCEDocID As String
        Dim strIMDocID As String
        'Dim appPath As String = Application.StartupPath()
        Dim appPath As String = AppDomain.CurrentDomain.BaseDirectory
        docNodes = xmlDoc.SelectNodes("//transaction/documents/document")
        If docNodes.Count = 0 Then

        Else
            For Each docNode In docNodes



                strIMDocID = docNode.SelectSingleNode("//im_doc_id").InnerText
                Dim strDoc As String = docNode.SelectSingleNode("doc_nbr").InnerText
                Console.WriteLine("StrIMDocID :" & strIMDocID)
                Console.WriteLine("DocID :" & strDoc)


            Next


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>