?? xmlutil.java
字號:
/**
* Project:ms4j (Message Server for Java)
* Date:2007-3-21
* Authoer : jobsun@gmail.com
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
package com.sunjob.ms4j.util;
import java.io.InputStream;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
/**
* @author sunjb
*
*/
public class XMLUtil {
Document doc = null;
public XMLUtil(InputStream is) throws DocumentException {
SAXReader read = new SAXReader();
doc = read.read(is);
}
public List getElements(String path) {
return doc.selectNodes(path);
}
public Node getElement(String path) {
return doc.selectSingleNode(path);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -