org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog.

org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
at dxm.com.test.ReadXML2.main(ReadXML2.java:39)

Nested exception: 


Content is not allowed in prolog :内容是不允许在序言。


去掉xml 申明文档的部分,就ok。

你可能感兴趣的:(java)