1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Dim xmlDoc As New XmlDocument
Dim xChapter As XmlElement
Try
Dim sTables As String = sXML
xmlDoc.LoadXml(sTables)
Catch ex As Exception
MsgBox(ex.Message)
End Try
xChapter = xmlDoc.DocumentElement
Dim lOuverture As New Ouverture
For Each noeud As XmlNode In xChapter
Dim lJour As New Jour With {.id = noeud.Attributes("id").Value}
Dim lPlages As New List(Of Plage)
For Each noeudfils As XmlNode In noeud.ChildNodes
Dim lPlage As New Plage With {.Debut = noeudfils.Attributes("début").Value, .Fin = noeudfils.Attributes("fin").Value}
lPlages.Add(lPlage)
Next
lJour.Plages = lPlages
lOuverture.Jours.Add(lJour)
Next
xmlDoc = Nothing |
Partager