I want to parse a XML file with the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<TopLevel FileFormat = "Config">
<ObjectList ObjectType = "Type1">
<o><a>value111</a><b>value121</b><c>value131<c/></o>
<o><a>value112</a><b>value122</b><c>value132<c/></o>
...
</ObjectList>
<ObjectList ObjectType = "Type2">
<o><a>value21</a><b>value22</b><c>value23<c/></o>
...
</ObjectList>
<ObjectList ObjectType = "Type3">
<o><a>value31</a><b>value32</b><c>value33<c/></o>
...
</ObjectList>
...
<ObjectList ObjectType = "TypeN">
<o><a>valueN1</a><b>valueN2</b><c>valueN3<c/></o>
...
</ObjectList>
</TopLevel>
I need only data from one node, e.g. 'ObjectList ObjectType = "Type3"'. It may not be the node in the 3rd position. I have to select it based on its name. Finally, the children of this node (a, b, c) should be stored in a data frame.
- How can I retrieve this node?
- How can I extract the child data into a data frame?
Any ideas? Thanks in advance!