日期:2014-05-19 浏览次数:20590 次
import org.jdom.Document; import org.jdom.Element; import org.jdom.input.SAXBuilder; public class JDOMTest { public static void main(String[] args) throws Exception { Document document = new SAXBuilder().build("xml.xml"); Element rootEle = document.getRootElement(); String cEle = rootEle.getChildText("c"); String gEle = rootEle.getChild("userinfo").getChildText("g"); } }