XMLUtil.java
上传用户:gtz2001
上传日期:2016-12-29
资源大小:2489k
文件大小:1k
- package net.meybo.util;
- import java.io.*;
- import org.dom4j.*;
- /**
- * 处理 XML 的工具类,它只被 XMLTool 类使用
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2005</p>
- * <p>Company:脉博软件 </p>
- * @author:阚吉彬
- * @version 1.0
- */
- class XMLUtil{
- XMLUtil(){
- }
- protected static void toXmlFile(Document xmlJDoc, String encoding, String fileName) throws FileNotFoundException, IOException {
- FileWriter file=new FileWriter(fileName);
- xmlJDoc.write(file);
- file.close();
- }
- protected static InputStream getInputStream(String xmlStr) throws Exception {
- return new ByteArrayInputStream(xmlStr.getBytes());
- }
- protected static Document buildDocument(Element el) {
- Document doc = null;
- doc=DocumentHelper.createDocument(el);
- return doc;
- }
- }