| | |
| | | package com.moral.common.util;
|
| | |
|
| | | import java.io.File;
|
| | | import java.net.URL;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | |
| | |
|
| | | public static List<Element> readDocument() {
|
| | | try {
|
| | | Document document = new SAXReader().read(new File("src/main/resources/system/city.xml"));
|
| | | URL url = Dom4jUtils.class.getClassLoader().getResource("system" + File.separator + "city.xml");
|
| | | Document document = new SAXReader().read(url);
|
| | | Element rootElement = document.getRootElement();
|
| | | elements = (ArrayList<Element>) rootElement.elements();
|
| | | System.out.println(elements.size());
|
| | | // System.out.println(elements.size());
|
| | | } catch (DocumentException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|