package cn.itcast.Utils;
import java.io.File;
import java.io.FileOutputStream;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
public class XmlUtils {
private static String filePath;
}
public static Document getDocument() throws Exception, DocumentException{
import java.io.File;
import java.io.FileOutputStream;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
public class XmlUtils {
private static String filePath;
static {
//其中user.xml 在src目录下
filePath=XmlUtils.class.getClassLoader().getResource("users.xml").getPath();}
public static Document getDocument() throws Exception, DocumentException{