I have the following xml file:
<?xml version="1.0"?>
<CONFIG>
<FUNCTION>
<NAME>FUNCT0</NAME>
<CALLS>
<FUNCTION>
<NAME>FUNCT0_0</NAME>
</FUNCTION>
</CALLS>
<CALLS>
<FUNCTION>
<NAME>FUNCT0_1</NAME>
</FUNCTION>
</CALLS>
</FUNCTION>
<FUNCTION>
<NAME>FUNCT1</NAME>
</FUNCTION>
</CONFIG>
I have a class called FunctionInfo which stores both a function's name and also contains an ArrayList to contains the subfunctions which the function calls.
I want to end up with an ArrayList which contains the top-level functions that will then store their subfunctions inside the object recursively.
I need this to work for an indefinite depth of recursion.
My question is what is the easiest way to write a recursive XML parser that can perform this task?
Edit: I am working in Java.
Thanks :)