So i have a XML File, structure looks like so:
<data>
<workouts>
...
<workout id="3">
<start>2021-11-22T07:10:34</start>
<end>2021-11-22T08:00:00</end>
<equipmentID>1</equipmentID>
<routeID>1</routeID>
<waypoints>
<waypoint>
<postitionX>48.24912599533484</postitionX>
<postitionY>14.491311098297038</postitionY>
<speed>23.56</speed>
<heartRate>98</heartRate>
</waypoint>
<waypoint>
<postitionX>48.240909352357015</postitionX>
<postitionY>14.516923658668736</postitionY>
<speed>24.67</speed>
<heartRate>101</heartRate>
</waypoint>
<waypoint>
<postitionX>48.246650516406596</postitionX>
<postitionY>14.547931919447299</postitionY>
<speed>25.34</speed>
<heartRate>104</heartRate>
</waypoint>
<waypoint>
<postitionX>48.226691625170645</postitionX>
<postitionY>14.58215015497887</postitionY>
<speed>24.56</speed>
<heartRate>108</heartRate>
</waypoint>
<waypoint>
<postitionX>48.23400548108094</postitionX>
<postitionY>14.622705354471632</postitionY>
<speed>25.57</speed>
<heartRate>115</heartRate>
</waypoint>
<waypoint>
<postitionX>48.239594794658636</postitionX>
<postitionY>14.640244022864664</postitionY>
<speed>22.45</speed>
<heartRate>117</heartRate>
</waypoint>
</waypoints>
</workout>
</workouts>
I am also creating classes to store the contents of it via tagname like so
public static ArrayList<Workout> workouts = new ArrayList<>();
private final int ID;
private final LocalDateTime start;
private final LocalDateTime end;
private final Equipment equipment;
private final Route route;
private final ArrayList<Waypoint> waypoints;
public Workout(int ID, LocalDateTime start, LocalDateTime end, Equipment equipment, Route route, ArrayList<Waypoint> waypoints) {
this.ID = ID;
this.start = start;
this.end = end;
this.equipment = equipment;
this.route = route;
this.waypoints = waypoints;
workouts.add(this);
}
and i want to implement it in my forms app to show the contents of it
in a Datagridview, but for some reason i cant put it as a Datasource
datagridView1.Datasource = Dataset.readXML("example.xml");
