I've got a strange XML-File as an output from another program. I have no control over it and unfortunately I cannot change it. Now I want to read this into a C#-application and work with it.
<?xml version="1.0" encoding="UTF-8"?>
<Table name="UnitData">
<Data type="STRING" header="UnitNumber"/>
<Data type="STRING" header="Date"/>
<Data type="STRING" header="Caller"/>
<Data type="STRING" header="CallerNumber"/>
<Data type="STRING" header="Location"/>
<Data type="STRING" header="Street"/>
<Row>
</Row>
<Row>
<Column value="123456789"/>
<Column value="16.03.2021"/>
<Column value="Person a"/>
<Column value="012-12321"/>
<Column value="London"/>
<Column value="NiceStreet"/>
<Table name="UnitCodes">
<Data type="STRING" header="UnitCodeEC"/>
<Data type="STRING" header="UnitCodeECDesc"/>
<Row>
</Row>
</Table>
<Data type="STRING" header="Name"/>
<Data type="STRING" header="Vorname"/>
<Row>
</Row>
</Table>
<Table name="Units">
<Data type="STRING" header="UnitName"/>
<Data type="STRING" header="UnitLocation"/>
<Data type="STRING" header="AlarmTime"/>
<Data type="STRING" header="EndTime"/>
<Row>
</Row>
<Row>
<Column value="Unit 1-A"/>
<Column value="Location 1"/>
<Column value="16.03.2021-20:11:45"/>
<Column value="16.03.2021-21:27:15"/>
</Row>
<Row>
<Column value="Unit 1-B"/>
<Column value="Location 1"/>
<Column value="16.03.2021-20:11:45"/>
<Column value="16.03.2021-21:27:15"/>
</Row>
<Row>
<Column value="Unit 2-A"/>
<Column value="Location 2"/>
<Column value="16.03.2021-20:11:45"/>
<Column value="16.03.2021-21:27:15"/>
</Row>
</Table>
</Row>
</Table>
I've found a lot of information on how to read XML files, but in no way is the XML file structured that crap way. A table in a table row with a header description.
The structure is always the same, sometimes with more Row's, but even if a value is empty, the Colum is still there. I think i can work with ID's, like in an array
document.row[0][0] = 123456789
document.row[0][3] = Person a
document.row[0].table('Units')[1][0] = Unit 1-B
Any Ideas? Thanks for you help