Jump to content
We've recently updated our Privacy Statement, available here ×

Problems with XML ENTITY


Recommended Posts

By: Aitor Garc a Rey - osirys

Problems with XML ENTITY

2002-12-16 09:16

Hi,

Is there some problem with xml entities?. I'm trying to get working a jasper report that load xml entities a getting this error:

 

Start of root element expected instead of TEXT '1.0' (and a Stack Trace from com.ms.xml.parser.Parser).

 

When I transform de DOS version of this file to a Unicode version the error is like that :

 

Invalid Element 'PCDATA' in content of 'JasperReport' Expected[ ... and a list of available DTD elements]. NOTE: In the entity file the elements are correct (reportFont).

 

It look like a problem with ms parser because the sample compile and run succesfully with the ant script that provide Jasperreports (that use xerces as parser).

 

A sample of this error can be found in the last version of Jasper Reports (0.4.4) at JasperReportsdemosamplesqueryQueryReport.xml

 

Somebody can tell me what I am doing wrong?

 

 

 

By: Giulio Toffoli - gt78

RE: Problems with XML ENTITY

2002-12-17 00:26

Ciao Aitor,

could you post the first 10 rows of xml file?

 

Thanks

 

Giulio

 

 

By: Aitor Garc a Rey - osirys

RE: Problems with XML ENTITY

2002-12-17 00:32

Sure:

 

<?xml version="1.0"?>

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd" [

<!ENTITY reportFonts SYSTEM "./ReportFonts.ent">

]>

 

<jasperReport

name="QueryReport"

pageWidth="595"

pageHeight="842"

columnWidth="515"

columnSpacing="0"

leftMargin="40"

rightMargin="40"

topMargin="50"

bottomMargin="50"

whenNoDataType="AllSectionsNoDetail">

 

&reportFonts;

 

<parameter name="ReportTitle" class="java.lang.String"/>

.....

and continues with the definition of parameters and the reports itself...

 

Thanks

Aitor

 

 

By: Aitor Garc a Rey - osirys

RE: Problems with XML ENTITY

2002-12-18 01:18

I understand. There is some other workaround for use entities with ireport? As long as I know there is no way to put the <!ENTITY element in other place that <!DOCTYPE directive ...

 

Thanks.

Aitor

 

 

 

 

By: Giulio Toffoli - gt78

RE: Problems with XML ENTITY

2002-12-18 04:21

There is no way that I know.

But you can create a void report that already contains your fonts definitions and use this report as template for new reports (you can set a file as "new report template" in the options panel of iReport)

 

GIULIO

 

 

By: Aitor Garc a Rey - osirys

RE: Problems with XML ENTITY

2002-12-18 05:08

Thanks Giulio for your interest but generate a template is only a choice for productivity and I am more worried for the maintenability of the reports. You can see about this in my post "Insert "include" like tags" to the JasperReports:

https://sourceforge.net/forum/forum.php?thread_id=779108&forum_id=113529

 

 

 

 

By: Giulio Toffoli - gt78

RE: Problems with XML ENTITY

2002-12-17 08:03

Ciao Aitor.

 

The xml code confirms my suspiciones...

iReport (really micorsoft xml parser) has a problem loading XML code with a directive like this:

 

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report

Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"; ...

 

The problem is not really a problem, but if you don't be connected to the internet, the ms parser fail to download http://jasperreports.sourceforge.net/dtds/jasperreport.dtd. JasperReport is not affected by this problem beacouse it load the dtd directly from your package. For this reason, iReport use this workaround: read the xml file, cut the directive <!DOCTYPE ....> and finally pass the xml to the parser. Width a entity declaration this trik don't run correctly and you got an error.

 

 

Giulio

 

 

 

By: Infogest - infogest

RE: Problems with XML ENTITY

2002-12-18 05:50

Is it possible to use xerces instead of m$ xml parser ?

 

 

 

By: Giulio Toffoli - gt78

RE: Problems with XML ENTITY

2002-12-18 11:03

Sorry, but xerces require java 2 (please don't send comment about the choice of using for iReport Visual J++ (that is jdk1.1.4 compliant), the reasons of this choise are ONLY the avability of the more efficent, simple to program, easy to use User Interfce; for the rest my opinion is the same of many others: to use a not java 2 compliant virtual machine is a *shit*!

 

Giulio

 

 

 

 

By: oneway - oneway

Choise of JDK

2003-02-04 11:19

Giulio: "Sorry, but xerces require java 2 (please don't send comment about the choice of using for iReport Visual J++ (that is jdk1.1.4 compliant), the reasons of this choise are ONLY the avability of the more efficent, simple to program, easy to use User Interfce; for the rest my opinion is the same of many others: to use a not java 2 compliant virtual machine is a *shit*!"

 

It's my impression that it's been a while since the last time you used Swing. I work with Swing every day (<a href="www.netbeans.org">NetBeans</a>) and do not have any performance issues.

 

This choise of JDK presents several problems: (a) you cannot take advantage of the latest APIs and performance improvements; (b) iReport is completely (and regretfully) useless for people who develop on Linux; © not many developers want to work with old 1.1.4 API, hence you limitting the amount of help you can get from the community.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...