【发布时间】:2017-02-21 08:58:32
【问题描述】:
我正在尝试通过 DOM 解析器读取 .html 文件,但它在解析时出现以下异常。
[Fatal Error] form3.html:559:133: The element type "font" must be terminated by the matching end-tag "</font>".
org.xml.sax.SAXParseException; systemId: file:/home/puja/Dnyaneshwar/WCD_14_02_17/FileConverter/resources/form3.html; lineNumber: 559; columnNumber: 133; The element type "font" must be terminated by the matching end-tag "</font>".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205)
at DomConverter.main(DomConverter.java:25)
【问题讨论】:
-
错误很明显你有一个打开的
<font>标签没有关闭</font>尝试修复它 -
其实我是通过 Libre office 将 doc 文件转换成 HTML。在这里,我通过手动编辑文件解决了很多上述问题,但该文件太大了。那么我们可以禁用这种检查吗?