XML parsing in java with JDOM(getChildren method returns no List)

For an xml file which its root has 25 children, getChildren method return list.size= 0 !!Here is my code:\[code\]public static void main(String[] args) { SAXBuilder builder = new SAXBuilder(); File xmlFile = new File("g:\\*"); try { Document document = (Document) builder.build(xmlFile); Element rootNode = document.getRootElement(); List list = rootNode.getChildren("job",Namespace.getNamespace("Montage")); for (int i = 0; i < list.size(); i++) { Element node = (Element) list.get(i); System.out.println("ID : " + node.getAttributeValue("id")); System.out.println("Run Time : " + node.getAttributeValue("runtime")); } } catch (IOException io) { System.out.println(io.getMessage()); } catch (JDOMException jdomex) { System.out.println(jdomex.getMessage()); } }\[/code\]Here the portion of xml file:\[code\]<adag xmlns="http://pegasus.isi.edu/schema/DAX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pegasus.isi.edu/schema/DAX http://pegasus.isi.edu/schema/dax-2.1.xsd" version="2.1" count="1" index="0" name="test" jobCount="25" fileCount="0" childCount="20"> <job id="ID00000" namespace="Montage" name="mProjectPP" version="1.0" runtime="13.39"> <uses file="region.hdr" link="input" register="true" transfer="true" optional="false" type="data" size="304" /> <uses file="2mass-atlas-ID00000s-jID00000.fits" link="input" register="true" transfer="true" optional="false" type="data" size="4222080" /> <uses file="p2mass-atlas-ID00000s-jID00000.fits" link="output" register="true" transfer="true" optional="false" type="data" size="4167312" /> <uses file="p2mass-atlas-ID00000s-jID00000_area.fits" link="output" register="true" transfer="true" optional="false" type="data" size="4167312" /> </job>\[/code\]What is wrong?
 
Back
Top