为什么Java Stax Xml Parser Block

时间:2015-11-08 17:14:06

标签: java stax jaxp

这样可行但是next()函数在解析几行之前等待3-4分钟。是什么原因?

XMLInputFactory xmlFact = XMLInputFactory.newInstance();
XMLStreamReader xmlReader = xmlFact.createXMLStreamReader(new FileReader(tempFolder + "/" + "file.xml"));

while (xmlReader.hasNext())
{
    System.out.println(xmlReader.getEventType());
    xmlReader.next();
}

在START_DOCUMENT

之后开始阻止

Xml内容:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE container PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
  <rootfiles xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
    <rootfile xmlns="urn:oasis:names:tc:opendocument:xmlns:container" full-path="123.opf" media-type="application/oebps-package+xml"/>
  </rootfiles>
</container>

0 个答案:

没有答案