We would like to know how to access values in XML with JDOM.
import org.jdom.Document; import org.jdom.input.SAXBuilder; /*from w ww. j a v a 2 s. co m*/ public class Test { public static void main(String[] args) throws Exception{ SAXBuilder builder = new SAXBuilder(); Document doc = builder.build("test.xml"); String id1 = doc.getRootElement().getChild("values").getChild("factor").getChild("id1").getValue(); System.out.println(id1); String id2 = doc.getRootElement().getChild("values").getChild("factor").getChild("id2").getValue(); System.out.println(id2); } }