i´m quite new to programming and especially new to XML parsing and i´m currently having issues with xml-parsing in java. I´ve tried several things to get specific information from a xml-file and writing it into an object, which later on will be put into an arraylist and sorted. Here´s a short cut from my XML-file (i changed names and values as i´m not sure if i´m allowed to share it.):
<things>
<code V="123"/>
<region V="38"/>
<hl_list>
<hl>
<stuff_hmv V="XXX" DN="some other stuff"/>
<secondary_code V="Z98"/>
<infotext V="max 12 units"/>
<kl_list>
<kl V="I" DN="some other stuff">
<diag_list>
<diag V="WS1" DN="illness 1"/>
<diag V="WS2" DN="illness 2"/>
<diag V="EX1" DN="illness 3"/>
</diag_list>
</kl>
</kl_list>
</hl>
</hl_list>
</things>
<things>
<code V="456"/>
<region V="45"/>
<hl_list>
<hl>
<stuff_hmv V="X1X" DN="some other stuff"/>
<infotext V="max 13 units"/>
<kl_list>
<kl V="II" DN="some other stuff">
<diag_list>
<diag V="WS1" DN="illness 3"/>
<diag V="WS2" DN="illness 2"/>
<diag V="EX1" DN="illness 4"/>
</diag_list>
</kl>
</kl_list>
</hl>
</hl_list>
</things>
This is basically what i´m working with. I have several "thing-blocks" and i need the following information (if existing) in my objects. If the object is filled it should be put into an arraylist and the next block continues. Information from xml:
- code
- region
- stuff_hmv
- secondary_code
- infotext
- kl
- every diag entry (i tried to put them into an arraylist in my object)
so far i´ve tried to get the information with getElementsByTagName and getters/setters for my object.