【问题标题】:Parsing xml data解析xml数据
【发布时间】:2015-07-12 10:49:55
【问题描述】:

有人知道如何解决这个异常吗?

java.io.FileNotFoundException: F:\eclipse\WS\l\dblp.dtd(系统找不到指定的文件)

即使我给出了正确的路径,我仍然得到这个异常。

这是我的 xml 代码:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE dblp SYSTEM "dblp.dtd">
<dblp>
<article mdate="2011-01-11" key="journals/acta/Saxena96">
  <author>Sanjeev Saxena</author>
  <title>Parallel Integer Sorting and Simulation Amongst CRCW Models.         </title> 
 <pages>607-619</pages>
 <year>1996</year>
 <volume>33</volume>
 <journal>Acta Inf.</journal>
 <number>7</number>
 <url>db/journals/acta/acta33.html#Saxena96</url>
 <ee>http://dx.doi.org/10.1007/BF03036466</ee>
</article>
<article mdate="2011-01-11" key="journals/acta/Simon83">
  <author>Hans-Ulrich Simon</author>
  <title>Pattern Matching in Trees and Nets.</title>
  <pages>227-248</pages>
  <year>1983</year>
  <volume>20</volume>
  <journal>Acta Inf.</journal>
  <url>db/journals/acta/acta20.html#Simon83</url>
  <ee>http://dx.doi.org/10.1007/BF01257084</ee>
  </article>
 </dblp>

【问题讨论】:

    标签: java xml parsing sax


    【解决方案1】:

    您在您的DOCTYPE 中引用了"dblp.dtd" - 您在异常中提到的目录中有那个 DTD 文件吗?

    如果没有并且您没有 DTD,请尝试从 xml 文件中删除 DOCTYPE 行,或覆盖实体分辨率以告诉它不要尝试加载它,如 this answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-03
      • 2013-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多