我正在尝试使用 Java 中的 DOM 解析器来解析一个小的 XML 文件,我从其 uri 中获取了网络,但收到了一个错误,提示缺少分号。
这是链接 108:
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("url_to_the_xml_file.xml");
错误如下:
[Fatal Error] A01.xml:6:53: The character reference must end with the ';' delimiter.
Exception in thread "main" org.xml.sax.SAXParseException: The character reference must end with the ';' delimiter.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)
at Parser.Parse(Parser.java:108)
at Parser.main(Parser.java:185)
解析这行 XML
<title>Reduction Algorithm using the À TROUS Wavelet Transform.</title>
显然少了一个分号。有谁知道这个问题有什么好的、整洁的解决方法吗?
最佳答案
使用
"?default=sample&page=homePage"
关于java - org.xml.sax.SAXParseException : The character reference must end with the ';' delimiter. 需要解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1043086/