DKARS MAGAZINE
BKN430av5sm
BKN430av5sm
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<br />
<br />
Code sample 7<br />
Here is the function itself, which should be put near the bottom.<br />
The input into this function is the HashMap that was created<br />
with the QSO data (Key=Value pairs, such as ‘call=PA3BHF’).<br />
Without going into too much detail, what the code does is first<br />
identifying the proper insertion point into the XML file, and then<br />
it gets all the keys out of the Key-value pairs (the ‘keySet’). This<br />
allows us to be flexible with the keys. This function doesn’t care<br />
which keys we have, it finds all keys and the corresponding values<br />
and put those as fields into a new XML record. Then it appends<br />
this new entry to the existing records.<br />
private Boolean addEntry(HashMap QSOinfo)<br />
throws Exception {<br />
NodeList nodeList = doc.getElementsByTagName("table");<br />
for(int x=0,size= nodeList.getLength(); x