Hi Good Guys,
I have another interest problem. I need your help. Thank you in advance.
I have created 2 format types (ELEMENT, ATTRIBUTE) of XML File. To open and read the ELEMENT Format type
and write the row into TEXT string for display is fine but the ATTRIBUTE Format is not working.
The problem is how to identify the format type at runtime in order to develop the script.
The scripts below works on ELEMENT format and not on ATTRIBUTE format type :
How to identify the Format type ?
---------------------------------------------------------
Code:
Imports System.Xml
Imports System.IO
Imports System.Data
Imports System.Text
Private Function FReadXMLFile()
Dim xmlDoc As New XmlDataDocument
Dim xmlNode As XmlNodeList
Dim intNode As Integer = 0
Dim x As Integer = 0
Dim i As Integer = 0
Dim strText As String ' use for display
Dim fs As New FileStream(Me.txtFileName.Text, FileMode.Open, FileAccess.Read)
xmlDoc.Load(fs)
Dim intRowCnt As Integer = xmlDoc.GetElementsByTagName("row").Count
xmlNode = xmlDoc.GetElementsByTagName("row")
For x = 0 To (intRowCnt - 2)
i = 0
For i = 0 To (xmlNode.Count - 3)
strText &= xmlNode(x).ChildNodes(i).InnerText.Trim & "|"
If i = (xmlNode.Count - 3) Then
strText &= ControlChars.NewLine
End If
Next
Next
MessageBox.Show(strText)
End Function