Hi other R enthusiasts.
I've been trying to figure out how to tidy up semi-structured XML's to pretty nxm tables. I've been struggeling to find good tutorials and i've found the documentation slightly advanced since i'm not used to dealing with these kinds of problems on a daily basis.
I have a very simplified xml structure below that I would like to tidy up into a tabular format.
Starting point - XML (For simplicity namespacing definitions is left out in this example)
<x1:root>
<x1:customers>
<x1:customer>
<x1:name>Customer1 </x1:name>
<x1:address>
<x1:streetname>SomeStreet</x1:streetname>
<x1:number>1</x1:number>
</x1:address>
<x1:zip>10069</x1:zip>
</x1:customer>
<x1:customer>
<x1:name>Customer2</x1:name>
<x1:address>
<x1:streetname>SomeStreetWithoutZip&Nr</x1:streetname>
</x1:address>
</x1:customer>
</x1:customers>
</x1:root>
Wanted structure (without ns)
(cols x rows)
Name | Streetname | Number | Zip
_________________________________________________________
Customer 1 SomeStreet 1 10069
Customer 2 SomeStreetWithoutZip NULL NULL
I've tried the XML's xmlToDataFrame but it's too simple. Can anyone point me in the right direction ?