不能读出xml内容 - Java / Web 开发
Java code:
package lier.basic;
import java.io.File;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class ReadXml{
public static void main(String[] args) {
SAXReader saxReader = null;
Document doc = null;
try {
saxReader = new SAXReader();
doc = saxReader.read(InitXmlLogin.initXML());
System.out.println(InitXmlLogin.initXML());
List<Element> list = doc.selectNodes("//bocb2e//head");
for (Element CdcEntryItem : list) {
String key = CdcEntryItem.elementTextTrim("trnid");
System.out.println(key);
}
} catch (DocumentException e) {
e.getMessage();
}
}
}
InitXmlLoginJava code:
package lier.basic;
public class InitXmlLogin {
public static String initXML()
{
String username=Getuserpwd.getuserpwd(1);
String pwd=Getuserpwd.getuserpwd(2);
String adate=Getdate.getdate();
StringBuffer fxml = new StringBuffer(&qu
相关问答:
请我用FCK上传文件,在本地的windows机上测试可以,但部署到linux服务器上就上传不了文件,上传文件时一直卡在那里。望各位大虾指点,谢谢!
路过,帮你顶一下。。。。。。。。。。。。。。
上传文件的路径问题, ......
Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' 打开刚创建的文件。
ReDim MyString(LOF(1) - 1)
Put #1, , MyRecord ' 读入所有字符到变量中 ......
现在有个xml文件是<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
我是个新手,望高手解答
我现在已经安装了mysql,也有mysql的jdbc。但我怎么配置后,才能在MyEclipse里操作mysql呢?请高手说详细点
打开Myeclipse----window---open perspective---MyEclipse database explorer-- ......