You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Joël Conraud <co...@heillecourt.semnet.tm.fr> on 2002/03/22 08:48:51 UTC

beginner (and windows) question

Hello,

I tried to use Microsoft’s entry point for Java when invoking fop, and thus
replaced ‘java’ by ‘jview’ in Fop.bat.

May be I’m doing something stupid here but I’m not a developer, just a user
of Java/fop, so it should be Ok, isn’it ?

When I ran fop on docs/examples/fo/simple.fo, I got the following problem :

jview -cp
build\fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xerces-1.2.3.jar;lib\ava
lon-framework-4.0.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar
org.apache.fop.apps.
Fop docs\examples\fo\simple.fo simple.pdf
java.lang.NoSuchMethodError: java/io/File: method
getParentFile()Ljava/io/File;
not found
        at org/apache/fop/apps/Options.setCommandLineOptions
        at org/apache/fop/apps/CommandLineStarter.<init>
        at org/apache/fop/apps/CommandLineOptions.getStarter
        at org/apache/fop/apps/Fop.main

ERREUR : java.lang.NoSuchMethodError: java/io/File: method
getParentFile()Ljava/
io/File; not found

Is it impossible to run fop this way ?

Is it another example of non portable java application (probably because of
issues on Windows side) ?

Thanks for you help,

Joël Conraud

RE: Page sequence error

Posted by Alastair Growcott <al...@pipstechnology.co.uk>.
Thanks.

They need to update "xslfoRef.pdf" in the FOP distribution.


> From: Guillaume Mathe [mailto:gmathe@smartinnov.com]
>
> FOP conforms to the latest specs - thus your 'master-name' in
> 'page-sequence' should be replaced with 'master-reference'.
> This holds true for other objects as
> well, take a look at FOP release notes:
> http://xml.apache.org/fop/relnotes.html




Re: Page sequence error

Posted by Guillaume Mathe <gm...@smartinnov.com>.
Hi,

On 26 Mar 2002 at 9:57, Alastair Growcott wrote:

> When running FOP on my XML document via XSL, I get the following error:
> 
> [ERROR]: org.apache.fop.apps.FOPException: 'master-reference' for
> 'fo:page-sequence'matches no 'simple-page-master' or
> 'page-sequence-master'
> 

FOP conforms to the latest specs - thus your 'master-name' in 'page-sequence' should be replaced with 'master-reference'. This holds true for other objects as 
well, take a look at FOP release notes:
http://xml.apache.org/fop/relnotes.html

Regards,
Guillaume Mathe
Smartinnov

Re: XML parsing

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Alastair Growcott wrote:
> Any chance that FOP will ever use the stylesheet specified in the XML
> file to peform the XSLT?

You can implement it yourself. Rip some code from Xalan or
Cocoon which extracts the stylesheet PI from the XML and
the logic to invoke the transformation, and pipe the
result to a FOP driver.

Hava fun!
J.Pietschmann


XML parsing

Posted by Alastair Growcott <al...@pipstechnology.co.uk>.
Any chance that FOP will ever use the stylesheet specified in the XML
file to peform the XSLT?




Let's get bold.

Posted by Alastair Growcott <al...@pipstechnology.co.uk>.
The XML line

	<?xml-stylesheet type="text/xsl"
href="file:///D:/XML/ccr_fo.xsl"?>

tells IE 6.0 to run the XSL file D:/XML/ccr_fo.xsl on the current XML
file and display the output (we are talking pure client-side here).

Is there a line that could be added to an XML file that would trigger a
piece of javascript or some sort of piece of java code? You can tell I'm
not a java developer. For example, maybe if the file type was changed to
e.g. "bin/java" or something. The java script could then act as a
wrapper for the entire FOP process of running the stylesheet and
converting to PDF.

I know this idea may be a bit ahead of its time, but wouldn't it be
nice...

If I find anything on this topic, do any of you want to know about it?




Page sequence error

Posted by Alastair Growcott <al...@pipstechnology.co.uk>.
When running FOP on my XML document via XSL, I get the following error:

[ERROR]: org.apache.fop.apps.FOPException: 'master-reference' for
'fo:page-sequence'matches no 'simple-page-master' or
'page-sequence-master'

which is odd since according to all the documentation I can find, there
is no master-reference property for a page-sequence object. The
master-name property is equal to the master-name specified when I
defined my simple-page-master object.

My XSL looks like:

<?xml version="1.0"?>
<xsl:stylesheet
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
     xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match ="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

  <fo:layout-master-set>
    <fo:simple-page-master
	margin-right="1.5cm"
	margin-left="1.5cm"
	margin-bottom="1cm"
	margin-top="1.5cm"
	page-width="21cm"
	page-height="29.7cm"
        master-name="a4p">
      <fo:region-body/>
    </fo:simple-page-master>

    <fo:simple-page-master
	margin-right="1.5cm"
	margin-left="1.5cm"
	margin-bottom="1cm"
	margin-top="1.5cm"
	page-width="29.7cm"
	page-height="21cm"
        master-name="a4l">
      <fo:region-body/>
    </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence master-name="a4p">
    <xsl:apply-templates select="ccjob"/>
  </fo:page-sequence>

</fo:root>
</xsl:template>

<xsl:template match="ccjob">
  <fo:flow flow-name="xsl-region-body">

    <fo:block font-size="18pt"
        font-family="sans-serif"
        line-height="20pt"
        space-after.optimum="12pt"
        color="black"
        text-align="center">
        Site Installation and Commissioning Test Report
    </fo:block>

    <fo:table space-after.optimum="12pt">
      <fo:table-column column-width="2cm"/>
      <fo:table-column column-width="2.5cm"/>
      <fo:table-column column-width="3cm"/>
      <fo:table-column column-width="3.5cm"/>
      <fo:table-column column-width="3cm"/>
      <fo:table-column column-width="4cm"/>

      <fo:table-body font-size="10pt" font-family="sans-serif">

        <fo:table-row line-height="12pt">
          <fo:table-cell>
            <fo:block text-align="left">
            Site ID:
            </fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block text-align="left">
            <xsl:value-of select="siteid"/>
            </fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block text-align="left">
            Job number:
            </fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block text-align="left">
            <xsl:value-of select="jobnumber"/>
            </fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block text-align="left">
            Site type:
            </fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block text-align="left">
            <xsl:value-of select="sitetype"/>
            </fo:block>
          </fo:table-cell>
        </fo:table-row>

      </fo:table-body>
    </fo:table>
  </fo:flow>
</xsl:template>

</xsl:stylesheet>



Re: beginner (and windows) question

Posted by Christian Geisert <ch...@isu-gmbh.de>.
Joël Conraud wrote:
> Hello,
> 
> I tried to use Microsoft?s entry point for Java when invoking fop, and 
> thus replaced ?java? by ?jview? in Fop.bat.
> 
> May be I?m doing something stupid here but I?m not a developer, just a 
> user of Java/fop, so it should be Ok, isn?it ?

AFAIK jview is JDK 1.1 only and FOP needs at least JDK1.2

> When I ran fop on docs/examples/fo/simple.fo, I got the following problem :
> 
> jview -cp 
> build\fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xerces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar 
> org.apache.fop.apps.
> 
> Fop docs\examples\fo\simple.fo simple.pdf

[..]

> ERREUR : java.lang.NoSuchMethodError: java/io/File: method 
> getParentFile()Ljava/
> io/File; not found
 >
> Is it impossible to run fop this way ?

I think yes ...
Why don't you use JDK/JRE from Sun (or IBM)

> Is it another example of non portable java application (probably because 
> of issues on Windows side) ?

No, it's another example that Microsoft doesn't like Java ;-)

> Thanks for you help,
> 
> Joël Conraud

Christian