Sample XML Data:
<ChapterContent
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Chapters>
<ChapterEntry><Number>1</Number><Time>70059</Time><Title>Joe</Title></ChapterEntry>
<ChapterEntry><Number>2</Number><Time>204172</Time><Title>Jim</Title></ChapterEntry>
<ChapterEntry><Number>3</Number><Time>220381</Time><Title>Harrison</Title></ChapterEntry>
<ChapterEntry><Number>4</Number><Time>348865</Time><Title>Billy</Title></ChapterEntry>
<ChapterEntry><Number>5</Number><Time>417046</Time><Title>Tom</Title></ChapterEntry>
<ChapterEntry><Number>6</Number><Time>458876</Time><Title>Chester</Title></ChapterEntry>
<ChapterEntry><Number>7</Number><Time>503876</Time><Title>Mike</Title></ChapterEntry>
<ChapterEntry><Number>8</Number><Time>562816</Time><Title>Donny</Title></ChapterEntry>
<ChapterEntry><Number>9</Number><Time>600409</Time><Title>Steve</Title></ChapterEntry>
<ChapterEntry><Number>10</Number><Time>649318</Time><Title>Jimbo</Title></ChapterEntry>
<ChapterEntry><Number>11</Number><Time>696459</Time><Title>Kane</Title></ChapterEntry>
<ChapterEntry><Number>12</Number><Time>775005</Time><Title>Sammy</Title></ChapterEntry>
<ChapterEntry><Number>13</Number><Time>843422</Time><Title>Eric</Title></ChapterEntry>
<ChapterEntry><Number>14</Number><Time>899541</Time><Title>Dre</Title></ChapterEntry>
</Chapters>
</ChapterContent>
Save the XML file to a location and parse through it with VB code:
Using
reader As XmlReader
= XmlReader.Create("C:\TEMP\test.xml")
While
reader.Read()
If
reader.IsStartElement() Then
If reader.Name = "Time"
Then
strTime = reader.ReadElementString("Time")
strBillNumber =
reader.ReadElementString("Title")
'this will be code to insert into table
sbTemp.Append("Time = " & strTime & " Name = " & strBillNumber & vbCrLf)
End If
End
If
End
While
End
Using