I am trying to use the HelloWorld example and use an external XML file to be read. I'm not sure what to put in public void run and what I would put in the getData part either. I looked at the other thread talking about DataAdapter using XML but when it wouldn't compile. So I just want to see if I'm on the right direction. Any help would be very much appreciated.
class GreetingsThread extends Thread {

private final Object itemHandle;
public volatile boolean go = true;

public GreetingsThread(Object itemHandle) {
this.itemHandle = itemHandle;
}

public void main(String argv[]) {

try {
File fXmlFile = new File("scoreboard.xml");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
doc.getDocumentElement().normalize();

System.out.println("Sport : " + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName("matchup");
System.out.println("-----------------------");

for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
System.out.println(getTagValue("away",eElement));
System.out.println(getTagValue("home",eElement));
System.out.println(getTagValue("score",eElement));
System.out.println(getTagValue("inning",eElement)) ;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}

private String getTagValue(String sTag, Element eElement) {
NodeList nlList = eElement.getElementsByTagName(sTag).item(0).getChi ldNodes();
Node nValue = (Node) nlList.item(0);

return nValue.getNodeValue();
}



public void run() {
int c = 0;
Random rand = new Random();


while(go) {
Map<String, String> data = new HashMap<String, String>();
data.put("xmldata", "");
data.put("timestamp", new Date().toString());

listener.smartUpdate(itemHandle, data, false);
c++;
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
}
}
}