DocumentBuilderFactory解释XML是否有长度限制?

抬头看路 2003-01-16 05:22:14
我用如下一段代码解释一个XML文本
XMLString中存放这段文本
但是只要长度超过16k解释的就不正常,超过16k的部分被扔掉了。
请问各位高人如何解决?
try
{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
db = dbf.newDocumentBuilder();
}
catch(Exception E)
{
...
}
try
{
XMLDocument = db.parse(new InputSource(new ByteArrayInputStream(XMLString)));
db = null;
}
catch(Exception E)
{
...
}
...全文
232 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hello_10000 2003-01-17
  • 打赏
  • 举报
回复
文件系统支持的长度都没有问题
54xx 2003-01-17
  • 打赏
  • 举报
回复
理论上没有限制,但是和你的内存相关。
whiteclude 2003-01-17
  • 打赏
  • 举报
回复
试用一下 jdom

InputStream in = connection.getInputStream();
SAXBuilder parser = new SAXBuilder();
Document response = parser.build(in);

文档可以在 www.jdom.org 或者 http://www.e999.net/apis/jdomb8_api/index.html
上找到
Anubis 2003-01-17
  • 打赏
  • 举报
回复
DocumentBuilderFactory换一个
ora.apache.xerces.parsers.DomParser看看!!
还有你的答案在这里找找
http://www-900.ibm.com/developerWorks/cn/education/xml/xmljava/tutorial/xmljava-menu.html

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧