Test-data: Nytt format
Omstrukturer data fra et format til et annet
Gitt et XML-dokument med noen objekter (generert av ChatGPT):
<?xml version="1.0" encoding="UTF-8"?>
<Vehicles>
<Vehicle>
<type>Car</type>
<manufacturer>Ford</manufacturer>
<countryOfOrigin>USA</countryOfOrigin>
<model>Mustang</model>
<year>2022</year>
</Vehicle>
<Vehicle>
<type>Plane</type>
<manufacturer>Boeing</manufacturer>
<countryOfOrigin>USA</countryOfOrigin>
<model>747</model>
<year>2019</year>
</Vehicle>
<Vehicle>
<type>Ship</type>
<manufacturer>Maersk</manufacturer>
<countryOfOrigin>Denmark</countryOfOrigin>
<model>Triple E Class</model>
<year>2018</year>
</Vehicle>
<Vehicle>
<type>Car</type>
<manufacturer>Toyota</manufacturer>
<countryOfOrigin>Japan</countryOfOrigin>
<model>Corolla</model>
<year>2021</year>
</Vehicle>
<Vehicle>
<type>Plane</type>
<manufacturer>Airbus</manufacturer>
<countryOfOrigin>France</countryOfOrigin>
<model>A320</model>
<year>2020</year>
</Vehicle>
<Vehicle>
<type>Ship</type>
<manufacturer>Carnival</manufacturer>
<countryOfOrigin>USA</countryOfOrigin>
<model>Cruise Line</model>
<year>2017</year>
</Vehicle>
<Vehicle>
<type>Car</type>
<manufacturer>Tesla</manufacturer>
<countryOfOrigin>USA</countryOfOrigin>
<model>Model S</model>
<year>2022</year>
</Vehicle>
<Vehicle>
<type>Plane</type>
<manufacturer>Embraer</manufacturer>
<countryOfOrigin>Brazil</countryOfOrigin>
<model>E195</model>
<year>2019</year>
</Vehicle>
<Vehicle>
<type>Ship</type>
<manufacturer>Royal Caribbean</manufacturer>
<countryOfOrigin>USA</countryOfOrigin>
<model>Oasis Class</model>
<year>2018</year>
</Vehicle>
<Vehicle>
<type>Car</type>
<manufacturer>BMW</manufacturer>
<countryOfOrigin>Germany</countryOfOrigin>
<model>3 Series</model>
<year>2021</year>
</Vehicle>
</Vehicles>
Konverter dette til et annet format, som for eksempel JSON.