In the app I’m currently working with the user is allowed to store a lot of settings divided in different categories in XML files.
The XML could look like
<settings>
<setting2>
<setting3>
<value1>foo</value1>
<value2>bar</value2>
</setting3>
<value3>A list of strings</value3>
</setting2>
<setting4>
<value4>An integer</value4>
</setting4>
</settings>
The thing I’m confused about is how to best structure the class containing this information, I started out by doing a recursive class containing a list of categories and values, and now I remembered that there is a tree collection class in Java and something like that would be the best solution?
What do you guys recommend?
Why not just load the entire XML file into an XPathDocument? It’s easy to use and quite speedy.
You could access individual settings like so: