Having problems with config

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Having problems with config

Theresa Forster

Hiya Guys,

 

After a long time I am trying to get FOP working locally with a java app (embedded)

 

org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20

 

This is the error I am getting on trying to load the config.

 

<fop version="1.0">

   
<!-- Strict user configuration -->
   
<strict-configuration>true</strict-configuration>

   
<!-- Strict FO validation -->
   
<strict-validation>true</strict-validation>

   
<!-- Base URL for resolving relative URLs -->
   
<base>./</base>

   
<!-- Font Base URL for resolving relative font URLs -->
   
<font-base>./</font-base>

   
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
   
<source-resolution>96</source-resolution>
   
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
   
<target-resolution>96</target-resolution>

 

And its crashing on line 1….

 

Any suggestions?

 

Theresa

Reply | Threaded
Open this post in threaded view
|

Re: Having problems with config

Alexios Giotis
Hi Theresa,

The config is XML, line 1 should be:
<?xml version="1.0"?>
HTH,
Alex

On 21 Nov 2018, at 13:29, Theresa Forster <[hidden email]> wrote:

Hiya Guys,
 
After a long time I am trying to get FOP working locally with a java app (embedded) 
 
org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20
 
This is the error I am getting on trying to load the config.
 
<fop version="1.0">

    
<!-- Strict user configuration -->
    
<strict-configuration>true</strict-configuration>

    
<!-- Strict FO validation -->
    
<strict-validation>true</strict-validation>

    
<!-- Base URL for resolving relative URLs -->
    
<base>./</base>

    
<!-- Font Base URL for resolving relative font URLs -->
    
<font-base>./</font-base>

    
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
    
<source-resolution>96</source-resolution>
    
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
    
<target-resolution>96</target-resolution>
 
And its crashing on line 1….
 
Any suggestions?
 
Theresa

Reply | Threaded
Open this post in threaded view
|

Re: Having problems with config

Luca Bellonda
In reply to this post by Theresa Forster
Hello, this error is usually reported when there is some text between the elements and it is not expected.
It can be caused also from CR/LF translations from Windows to Unix.
Try rewriting your file from scratch on target system in a new file.
Try to paste the only elements without comments or blank lines.

Best regards.

Il giorno mer 21 nov 2018 alle ore 12:29 Theresa Forster <[hidden email]> ha scritto:

Hiya Guys,

 

After a long time I am trying to get FOP working locally with a java app (embedded)

 

org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20

 

This is the error I am getting on trying to load the config.

 

<fop version="1.0">

   
<!-- Strict user configuration -->
   
<strict-configuration>true</strict-configuration>

   
<!-- Strict FO validation -->
   
<strict-validation>true</strict-validation>

   
<!-- Base URL for resolving relative URLs -->
   
<base>./</base>

   
<!-- Font Base URL for resolving relative font URLs -->
   
<font-base>./</font-base>

   
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
   
<source-resolution>96</source-resolution>
   
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
   
<target-resolution>96</target-resolution>

 

And its crashing on line 1….

 

Any suggestions?

 

Theresa

Reply | Threaded
Open this post in threaded view
|

RE: Having problems with config

Theresa Forster

Its running via intellij and reports as UTF-8 encoding, the file was pasted in via copy paste from the sample from FOP.

Its running on a windows machine not changing platform so not sure whats going on?

 

The lines are ending CRLF  but why would SAX have problems with that?

 

Theresa

 

 

From: Luca Bellonda [mailto:[hidden email]]
Sent: 25 November 2018 11:18
To: [hidden email]
Subject: Re: Having problems with config

 

Hello, this error is usually reported when there is some text between the elements and it is not expected.

It can be caused also from CR/LF translations from Windows to Unix.

Try rewriting your file from scratch on target system in a new file.

Try to paste the only elements without comments or blank lines.

 

Best regards.

 

Il giorno mer 21 nov 2018 alle ore 12:29 Theresa Forster <[hidden email]> ha scritto:

Hiya Guys,

 

After a long time I am trying to get FOP working locally with a java app (embedded)

 

org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20

 

This is the error I am getting on trying to load the config.

 

<fop version="1.0">

   
<!-- Strict user configuration -->
   
<strict-configuration>true</strict-configuration>

   
<!-- Strict FO validation -->
   
<strict-validation>true</strict-validation>

   
<!-- Base URL for resolving relative URLs -->
   
<base>./</base>

   
<!-- Font Base URL for resolving relative font URLs -->
   
<font-base>./</font-base>

   
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
   
<source-resolution>96</source-resolution>
   
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
   
<target-resolution>96</target-resolution>

 

And its crashing on line 1….

 

Any suggestions?

 

Theresa

Reply | Threaded
Open this post in threaded view
|

RE: Having problems with config

Theresa Forster
In reply to this post by Alexios Giotis

This file is copied almost directly from the official FOP example

https://xmlgraphics.apache.org/fop/0.95/configuration.html

 

<fop version="1.0">

 

  <!-- Strict user configuration -->

  <strict-configuration>true</strict-configuration>

 

  <!-- Strict FO validation -->

  <strict-validation>true</strict-validation>

 

  <!-- Base URL for resolving relative URLs -->

  <base>./</base>

 

  <!-- Font Base URL for resolving relative font URLs -->

  <font-base>./</font-base>

 

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->

  <source-resolution>72</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->

  <target-resolution>72</target-resolution>

 

  <!-- default page-height and page-width, in case

       value is specified as auto -->

  <default-page-settings height="11in" width="8.26in"/>

 

  <!-- etc. etc..... -->

</fop>

 

Theresa

 

From: Alexios Giotis [mailto:[hidden email]]
Sent: 22 November 2018 07:57
To: [hidden email]
Subject: Re: Having problems with config

 

Hi Theresa,

 

The config is XML, line 1 should be:

<?xml version="1.0"?>

HTH,

Alex



On 21 Nov 2018, at 13:29, Theresa Forster <[hidden email]> wrote:

 

Hiya Guys,

 

After a long time I am trying to get FOP working locally with a java app (embedded) 

 

org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20

 

This is the error I am getting on trying to load the config.

 

<fop version="1.0">

    
<!-- Strict user configuration -->
    
<strict-configuration>true</strict-configuration>

    
<!-- Strict FO validation -->
    
<strict-validation>true</strict-validation>

    
<!-- Base URL for resolving relative URLs -->
    
<base>./</base>

    
<!-- Font Base URL for resolving relative font URLs -->
    
<font-base>./</font-base>

    
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
    
<source-resolution>96</source-resolution>
    
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
    
<target-resolution>96</target-resolution>

 

And its crashing on line 1….

 

Any suggestions?

 

Theresa

 

Reply | Threaded
Open this post in threaded view
|

Re: Having problems with config

Luca Bellonda

I am unable to answer to your question without testing your file, but given the error, it seems that some text has been pasted into elements where is not expected. Maybe the copy and paste from HTML generated some extraneous artifact.

My advice is to rewriting it from scratch.
There is a sample config file in fop sources, use it as last test.
You can download it from Apache SVN:

Best regards.


Il giorno dom 25 nov 2018 alle ore 13:01 Theresa Forster <[hidden email]> ha scritto:

This file is copied almost directly from the official FOP example

https://xmlgraphics.apache.org/fop/0.95/configuration.html

 


 

Reply | Threaded
Open this post in threaded view
|

Re: Having problems with config

Szeak (Register Man)
In reply to this post by Theresa Forster
Hi, Theresa

I think, as Alex wrote, the config file content need to be started with:
<?xml version="1.0"?>

So, it will be:
<?xml version="1.0"?>

<fop version="1.0">

 

  <!-- Strict user configuration -->

  <strict-configuration>true</strict-configuration>

 

  <!-- Strict FO validation -->

  <strict-validation>true</strict-validation>

 

  <!-- Base URL for resolving relative URLs -->

  <base>./</base>

 

  <!-- Font Base URL for resolving relative font URLs -->

  <font-base>./</font-base>

 

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->

  <source-resolution>72</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->

  <target-resolution>72</target-resolution>

 

  <!-- default page-height and page-width, in case

       value is specified as auto -->

  <default-page-settings height="11in" width="8.26in"/>

 

  <!-- etc. etc..... -->

</fop>


Csaba


2018. 11. 25. 13:01 keltezéssel, Theresa Forster írta:

This file is copied almost directly from the official FOP example

https://xmlgraphics.apache.org/fop/0.95/configuration.html

 

<fop version="1.0">

 

  <!-- Strict user configuration -->

  <strict-configuration>true</strict-configuration>

 

  <!-- Strict FO validation -->

  <strict-validation>true</strict-validation>

 

  <!-- Base URL for resolving relative URLs -->

  <base>./</base>

 

  <!-- Font Base URL for resolving relative font URLs -->

  <font-base>./</font-base>

 

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->

  <source-resolution>72</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->

  <target-resolution>72</target-resolution>

 

  <!-- default page-height and page-width, in case

       value is specified as auto -->

  <default-page-settings height="11in" width="8.26in"/>

 

  <!-- etc. etc..... -->

</fop>

 

Theresa

 

From: Alexios Giotis [[hidden email]]
Sent: 22 November 2018 07:57
To: [hidden email]
Subject: Re: Having problems with config

 

Hi Theresa,

 

The config is XML, line 1 should be:

<?xml version="1.0"?>

HTH,

Alex



On 21 Nov 2018, at 13:29, Theresa Forster <[hidden email]> wrote:

 

Hiya Guys,

 

After a long time I am trying to get FOP working locally with a java app (embedded) 

 

org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20

 

This is the error I am getting on trying to load the config.

 

<fop version="1.0">

    
<!-- Strict user configuration -->
    
<strict-configuration>true</strict-configuration>

    
<!-- Strict FO validation -->
    
<strict-validation>true</strict-validation>

    
<!-- Base URL for resolving relative URLs -->
    
<base>./</base>

    
<!-- Font Base URL for resolving relative font URLs -->
    
<font-base>./</font-base>

    
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
    
<source-resolution>96</source-resolution>
    
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
    
<target-resolution>96</target-resolution>

 

And its crashing on line 1….

 

Any suggestions?

 

Theresa

 


--------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: Having problems with config

Theresa Forster
In reply to this post by Theresa Forster

I finally found the issue with this.

 

It is a little silly

 

In the config file there was an embedded comment

 

<!--  this is a comment

       //TODO:this is also a comment

-->

 

But this was being classed as mixed content – talk about sax being a pain.

 

Theresa

 

From: Theresa Forster [mailto:[hidden email]]
Sent: 25 November 2018 12:02
To: [hidden email]
Subject: RE: Having problems with config

 

This file is copied almost directly from the official FOP example

https://xmlgraphics.apache.org/fop/0.95/configuration.html

 

<fop version="1.0">

 

  <!-- Strict user configuration -->

  <strict-configuration>true</strict-configuration>

 

  <!-- Strict FO validation -->

  <strict-validation>true</strict-validation>

 

  <!-- Base URL for resolving relative URLs -->

  <base>./</base>

 

  <!-- Font Base URL for resolving relative font URLs -->

  <font-base>./</font-base>

 

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->

  <source-resolution>72</source-resolution>

  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->

  <target-resolution>72</target-resolution>

 

  <!-- default page-height and page-width, in case

       value is specified as auto -->

  <default-page-settings height="11in" width="8.26in"/>

 

  <!-- etc. etc..... -->

</fop>

 

Theresa

 

From: Alexios Giotis [[hidden email]]
Sent: 22 November 2018 07:57
To: [hidden email]
Subject: Re: Having problems with config

 

Hi Theresa,

 

The config is XML, line 1 should be:

<?xml version="1.0"?>

HTH,

Alex

 

On 21 Nov 2018, at 13:29, Theresa Forster <[hidden email]> wrote:

 

Hiya Guys,

 

After a long time I am trying to get FOP working locally with a java app (embedded) 

 

org.xml.sax.SAXException: Not allowed to define mixed content in the element fop at null:1:20

 

This is the error I am getting on trying to load the config.

 

<fop version="1.0">

    
<!-- Strict user configuration -->
    
<strict-configuration>true</strict-configuration>

    
<!-- Strict FO validation -->
    
<strict-validation>true</strict-validation>

    
<!-- Base URL for resolving relative URLs -->
    
<base>./</base>

    
<!-- Font Base URL for resolving relative font URLs -->
    
<font-base>./</font-base>

    
<!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
    
<source-resolution>96</source-resolution>
    
<!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
    
<target-resolution>96</target-resolution>

 

And its crashing on line 1….

 

Any suggestions?

 

Theresa