org.xml.sax.SAXParseException:文档根元素“jasperReport”必须与DOCTYPE根“null”匹配。 [英] org.xml.sax.SAXParseException: Document root element "jasperReport", must match DOCTYPE root "null"

查看:806
本文介绍了org.xml.sax.SAXParseException:文档根元素“jasperReport”必须与DOCTYPE根“null”匹配。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个使用Jasper Reports + iReport发布报告的应用程序,所有这一切都很顺利,直到我在运行程序时遇到此错误。我不是很喜欢xml所以请在帮助时考虑我一个菜鸟,所以请帮帮我,这是我的report.jrxml文件

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. 确保文档格式正确。在根元素的开始标记中,删除左尖括号后面的空格,使其显示为< jasperReport

请参阅 http:// coffeecokeandcode。 blogspot.com/2008/11/jasper-reports-and-legacy-formats.html

这篇关于org.xml.sax.SAXParseException:文档根元素“jasperReport”必须与DOCTYPE根“null”匹配。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆