Sub XOMBuilder1_BuildDone(XOMDocument1 As XOMDocument, Tag As Object)
'Gibt die Tabelle als List of Maps zurück
Dim RootElement As XOMElement
Dim xmlTables As XOMElements
Dim xmlcTables As XOMElements
Dim xmlRows As XOMElements
Dim xmlcRows As XOMElements
Dim xmlValues As XOMElements
Dim xmlcValues As XOMElements
Dim xmlTable As XOMElement
Dim xmlcTable As XOMElement
Dim xmlRow As XOMElement
Dim xmlcRow As XOMElement
Dim xmlValue As XOMElement
Dim xmlcValue As XOMElement
Dim cName As XOMElement
Dim cValue As XOMElement
Dim cType As XOMElement
Dim dt As Long : dt = 0
Dim m As Map : m.Initialize
Dim l As List : l.Initialize
If XOMDocument1.IsInitialized Then
Log("XOMDocument is initialized")
RootElement=XOMDocument1.RootElement
xmlTables = RootElement.GetChildElementsByName("tables")
For i1 = 0 To xmlTables.Size - 1
xmlTable = xmlTables.GetElement(i1)
xmlcTables = xmlTable.GetChildElementsByName("cTable")
For i2 = 0 To xmlcTables. Size - 1
xmlcTable = xmlcTables.GetElement(i2)
xmlRows = xmlcTable.GetChildElementsByName("rows")
For i3 = 0 To xmlRows.Size - 1
xmlRow = xmlRows.GetElement(3)
xmlcRows = xmlRow.GetChildElementsByName("cRow")
For i4 = 0 To xmlcRows.Size - 1
xmlcRow = xmlcRows.GetElement(i4)
xmlValues = xmlcRow.GetChildElementsByName("Values")
For i5 = 0 To xmlValues.Size - 1
xmlValue = xmlValues.GetElement(i5)
xmlcValues = xmlValue.GetChildElementsByName("cValue")
For i6 = 0 To xmlcValues.Size - 1
xmlcValue = xmlcValues.GetElement(i6)
m.Initialize
cName = xmlcValue.GetFirstChildElementByName("columnName")
cType = xmlcValue.GetFirstChildElementByName("valueName")
Select Case cType.Value
Case "System.String"
cValue = xmlcValue.GetFirstChildElementByName("valueStr")
m.Put(cName.Value, cValue.Value)
Case "System.Int32"
cValue = xmlcValue.GetFirstChildElementByName("valueInt")
m.Put(cName.Value, cValue.Value)
Case "System.Double"
cValue = xmlcValue.GetFirstChildElementByName("valueDbl")
m.Put(cName.Value, cValue.Value)
Case "System.Boolean"
cValue = xmlcValue.GetFirstChildElementByName("valueBool")
If cValue.Value = "True" Then
m.Put(cName.Value, "1")
Else
m.Put(cName.Value, "0")
End If
Case "System.DateTime"
cValue = xmlcValue.GetFirstChildElementByName("valueDateTime")
DateTime.DateFormat = params.dtFormat
dt = DateTime.DateParse(cValue.Value.Replace("T"," "))
m.Put(cName.Value, dt)
Case "System.Guid"
cValue = xmlcValue.GetFirstChildElementByName("valueGuid")
m.Put(cName.Value, cValue.Value)
Log (cName.Value & "=" & cValue.Value)
End Select
Next
Next
Next
Next
Next
Next
'Kontrolle der Rückgabelist
For k = 0 To l.Size - 1
m = l.Get(k)
For x = 0 To m.Size - 1
Log (m.GetKeyAt(x))
Log (m.GetValueAt(x))
Next
Next
Else
' XOMDocument1 will be uninitialized if an error has occurred
Log("An error has occured and the XOMDocument has NOT been initialized")
Log(LastException.Message)
End If
SaveListToDB(CallbackActivity, l)
End Sub