gpt4 book ai didi

java - 解析 xml 数据

转载 作者:行者123 更新时间:2023-11-30 08:52:56 25 4
gpt4 key购买 nike

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

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>

最佳答案

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

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

关于java - 解析 xml 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30006625/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com