Greetings!
I have an XML file that I am trying to parse but I am having a problem getting the attributes of the nodes. Here is what the xml file looks like:
<ILS_BULK_EXPORT>
<Loan MISMOVersionIdentifier="2.6" E3_ApplicationNumber="1234567890" E3_LoanNumber="0987654321">
<_APPLICATION _ID="some really long number">
<_DATA_INFORMATION>
<DATA_VERSION_Name="something" _NUMBER="2.6.2.1">
and on and on it goes...and the code I am using:
Private Sub ParseFile()
Try
Dim m_xmlDoc As XmlDocument
Dim m_nodeList As XmlNodeList
Dim m_node As XmlNode
m_xmlDoc = New XmlDocument
'm_xmlDoc.Load(txtFileToParse.Text)
m_xmlDoc.Load("C:\Documents and Settings\jmuslin\Desktop\AfterUpgrade.xml")
m_nodeList = m_xmlDoc.DocumentElement.SelectNodes("Loan MISMOVersionIdentifier='2.6'")
For Each m_node In m_nodeList
MessageBox.Show(m_node.Attributes("E3_ApplicationNumber").Value.ToString)
Next
'm_nodeList = m_xmlDoc.SelectNodes("ILS_BULK_EXPORT/Loan MISMOVersionIdentifier='2.6' ")
'For Each m_node In m_nodeList
' Dim appNumber = m_node.Attributes.GetNamedItem("E3_LoanNumber").Value
' MessageBox.Show(appNumber)
'Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
And the error: 'Loan MISMOVersionIdentifier='2.6" has an invalid token
so..my question is...how do I get specific node attributes? I don't need them all, as this is a HUGE xml file. Not only will I need to know the node I am pulling the attibutes out of, I also need to get the data out of specific nodes...
clear as mud?
Any help would be greatly appreciated.
thanks
I have an XML file that I am trying to parse but I am having a problem getting the attributes of the nodes. Here is what the xml file looks like:
<ILS_BULK_EXPORT>
<Loan MISMOVersionIdentifier="2.6" E3_ApplicationNumber="1234567890" E3_LoanNumber="0987654321">
<_APPLICATION _ID="some really long number">
<_DATA_INFORMATION>
<DATA_VERSION_Name="something" _NUMBER="2.6.2.1">
and on and on it goes...and the code I am using:
Private Sub ParseFile()
Try
Dim m_xmlDoc As XmlDocument
Dim m_nodeList As XmlNodeList
Dim m_node As XmlNode
m_xmlDoc = New XmlDocument
'm_xmlDoc.Load(txtFileToParse.Text)
m_xmlDoc.Load("C:\Documents and Settings\jmuslin\Desktop\AfterUpgrade.xml")
m_nodeList = m_xmlDoc.DocumentElement.SelectNodes("Loan MISMOVersionIdentifier='2.6'")
For Each m_node In m_nodeList
MessageBox.Show(m_node.Attributes("E3_ApplicationNumber").Value.ToString)
Next
'm_nodeList = m_xmlDoc.SelectNodes("ILS_BULK_EXPORT/Loan MISMOVersionIdentifier='2.6' ")
'For Each m_node In m_nodeList
' Dim appNumber = m_node.Attributes.GetNamedItem("E3_LoanNumber").Value
' MessageBox.Show(appNumber)
'Next
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
And the error: 'Loan MISMOVersionIdentifier='2.6" has an invalid token
so..my question is...how do I get specific node attributes? I don't need them all, as this is a HUGE xml file. Not only will I need to know the node I am pulling the attibutes out of, I also need to get the data out of specific nodes...
clear as mud?
Any help would be greatly appreciated.
thanks