散100分!为了她,好几天没睡好觉了!up有分! 你用jdom读取的时候,多了一个元素,仔细看你的代码吧估计是读根目录的下遍历误差我以前用过jdom现在不太了解了good luck! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 xsl不是很了解帮不上忙的 刚才得分析好像不对:)你在客户端用的是IEjdom在好像在父节点的第一个子节点都是一个空字符串,然后才是你自己的节点,我记得好像是这样的,好久没用,忘了:)你看看有没有考虑这种情况? 可惜没有用过jdom,愿你的问题早日解决。 用<pre></pre>标签把<textarea>标签包起来试试 谢谢楼上的朋友!问题还是没有解决!其它朋友能否提供一些可能的思路?提供一些线索也可以呀!难道这是jdom自身的bug吗?多谢!多谢! 我的xsl文件是这样写,不知道错在什么地方?<?xml version="1.0" encoding="GB2312"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"><xsl:output indent="yes"/><xsl:template match="/root"><html><head></head><body bgcolor="#FFFFFF" text="#000000"><form name="form1" method="post" action="/user?actionid=test"><table width="90%" border="0" cellpadding="0" cellspacing="1"> <tr> <td> <textarea name="areaName" style="width:100%;height:200"><xsl:value-of select="name"/></textarea> </td> </tr></table><input type="submit" name="submit1" value="保存"></input> <input type="button" name="button1" value="返回" onclick="history.go(-1)"></input></form></body></html></xsl:template></xsl:stylesheet>javaBean中的解析代码如下:Element rootEle=new Element("root");con=db.getConnection();stmt=con.createStatement(); Element nameEle=new Element("name");sql="select name from table1 where id=1";rs=stmt.executeQuery(sql);while(rs.next()){ nameEle.addContent(rs.getString(1));}rootEle.addContent(nameEle);Document xmlDoc=new Document(rootEle);JDOMSource xmlSource=new JDOMSource(xmlDoc);TransformerFactory transFactory=TransformerFactory.newInstance();StreamSource xslSource=new StreamSource(new FileInputStream(xslFile));Transformer transFormer=transFactory.newTransformer(xslSource);transFormer.setOutputProperty(OutputKeys.ENCODING,"GB2312");StreamResult result=new StreamResult(reponse.getOutputStream());transFormer.transform(xmlSource,result); =============================================================to javafounder(漂流):我是在本机测试,win2k,mssql2k,tomcat4.1.12客户端和服务器字符集都用的是GB2312===================================================to java831(希望):我试了一下<pre></pre>标签,但问题依旧!==================================================================================================================================================================当保存返回时一切正常!可是如果此后进入其它页面然后再次进入此页面时就会多出一个空白行!查看生成的HTML文件的代码如下:<table cellspacing="1" cellpadding="0" border="0" width="90%"><tr><td><textarea style="width:100%;height:200" name="areaName">张三 李四</textarea></td></tr></table> 在页面触发javascript的问题 高难度问题,欢迎高手挑战,100分!!!!!!!!!!!!!!!!!!!! 字符"2002-11-12",我要转换成日期型后,然后再分别提出年,月,日 jsp编程连接数据库出错!!!!急,请高手支招!!!! 调用CLASS的问题(今晚第二问题,第一已经结贴) 高手帮忙啊 急急急,帮我看看这个错误怎么解决!! jsp链接数据库问题 问一个简单的问题 类型转换…………在线等 怎么解决url里带中文参数的问题??(jsp+oracle9i) import 的问题
不是很了解
帮不上忙的
jdom在好像在父节点的第一个子节点都是一个空字符串,然后才是你自己的节点,
我记得好像是这样的,好久没用,忘了:)你看看有没有考虑这种情况?
问题还是没有解决!其它朋友能否提供一些可能的思路?提供一些线索也可以呀!
难道这是jdom自身的bug吗?
多谢!多谢!
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output indent="yes"/>
<xsl:template match="/root">
<html>
<head>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="/user?actionid=test">
<table width="90%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td>
<textarea name="areaName" style="width:100%;height:200"><xsl:value-of select="name"/></textarea>
</td>
</tr>
</table>
<input type="submit" name="submit1" value="保存"></input> 
<input type="button" name="button1" value="返回" onclick="history.go(-1)"></input>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>javaBean中的解析代码如下:Element rootEle=new Element("root");
con=db.getConnection();
stmt=con.createStatement();
Element nameEle=new Element("name");
sql="select name from table1 where id=1";
rs=stmt.executeQuery(sql);
while(rs.next()){
nameEle.addContent(rs.getString(1));
}rootEle.addContent(nameEle);
Document xmlDoc=new Document(rootEle);
JDOMSource xmlSource=new JDOMSource(xmlDoc);
TransformerFactory transFactory=TransformerFactory.newInstance();
StreamSource xslSource=new StreamSource(new FileInputStream(xslFile));
Transformer transFormer=transFactory.newTransformer(xslSource);
transFormer.setOutputProperty(OutputKeys.ENCODING,"GB2312");
StreamResult result=new StreamResult(reponse.getOutputStream());
transFormer.transform(xmlSource,result);
=============================================================
to javafounder(漂流):
我是在本机测试,win2k,mssql2k,tomcat4.1.12
客户端和服务器字符集都用的是GB2312
===================================================
to java831(希望):
我试了一下<pre></pre>标签,但问题依旧!======================================================
======================================================
======================================================
当保存返回时一切正常!可是如果此后进入其它页面然后再次进入此页面时就会多出一个空白行!
查看生成的HTML文件的代码如下:
<table cellspacing="1" cellpadding="0" border="0" width="90%">
<tr>
<td><textarea style="width:100%;height:200" name="areaName">张三
李四</textarea></td>
</tr>
</table>