I am doing a development, and some data that I use in terms of design should be represented in a tree, specifically they are ranks, that is, there is a boss who has at his command 5 sergeants who have their order to 5 corporals etc.
This I have represented with an xml.
<Grupo>
<jefe>
<sargento>
<cabo>
<cabo/>
</sargento>
</jefe>
</Grupo>
In java I have the classes defined with the fields of XML
, the question is what recommendation would you give me, create a Java tree to load this structure and make the changes queries etc there is or use XPath
to read data and save data about file XML
directly.
Say that only the person who is using the application will access the XML
file.
In my opinion I think it would be best to take advantage of the tree data structure that has XML
and use XPath
to make queries or modifications etc instead of loading everything into the software.