import java.io.File;  
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
    import org.jdom.Document;  
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.Element;
import org.jdom.JDOMException;
    import org.jdom.input.SAXBuilder;  
          
public class Net {
public static void main(String[] args) throws JDOMException, IOException {
            
File f = new File("c:/Teste/arquivo.xml");
SAXBuilder sb = new SAXBuilder();
Document d = sb.build(f);
for (int i = 0; i                 Element leitura = (Element)d.getRootElement().getChildren().get(i);  
List elements = leitura.getChildren();
Iterator j = elements.iterator();
System.out.println(leitura);
while (j.hasNext()) {
Element element = (Element) j.next();
String nome = element.getName();
List dados = element.getAttributes();
System.out.println(element);
}
              
}
}
} 
public class Net {
public static void main(String[] args) throws JDOMException, IOException {
File f = new File("c:/Teste/arquivo.xml");
SAXBuilder sb = new SAXBuilder();
Document d = sb.build(f);
for (int i = 0; i
List elements = leitura.getChildren();
Iterator j = elements.iterator();
System.out.println(leitura);
while (j.hasNext()) {
Element element = (Element) j.next();
String nome = element.getName();
List dados = element.getAttributes();
System.out.println(element);
}
}
}
}
 
Nenhum comentário :
Postar um comentário