org.xml.sax.SAXParseException: Document root element “jasperReport”, must match DOCTYPE root “null”

五迷三道 提交于 2019-12-02 06:32:33

问题


I am trying t develop an application which gives out the report using Jasper Reports+iReport, all the thing went fine until i got this error on running the program. I am not much into xml so please consider me a noob while helping, so Please help me out, here is my report.jrxml file

<?xml version="1.0" encoding="UTF-8"?>
< jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" 
       name="report1" 
       language="groovy" 
       pageWidth="595" 
       pageHeight="842" 
       columnWidth="555" 
       leftMargin="20" 
       rightMargin="20" 
       topMargin="20" 
       bottomMargin="20">
    .................................
    ..............
    ............
</jasperReport>

回答1:


Two things:

  1. Make sure that the document is well-formed. In the start tag of the root element, remove the space after the left angle bracket so that it reads <jasperReport.

  2. See http://coffeecokeandcode.blogspot.com/2008/11/jasper-reports-and-legacy-formats.html



来源:https://stackoverflow.com/questions/5754283/org-xml-sax-saxparseexception-document-root-element-jasperreport-must-match

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!