Sign In/My Account | View Cart  
advertisement

Article:
 Controlling Whitespace, Part Three
Subject: Compilation Error occur with the add tab example
Date: 2003-01-20 20:22:36
From: Eddie Cheng

Hi,


I have copied the source as below for running.
<?xml version="1.0" standalone="yes"?>
<employees>
<employee hireDate="04/23/1999">
<last>Hill</last>
<first>Phil</first>
<salary>100000</salary>
</employee>
<employee hireDate="09/01/1998">
<last>Herbert</last>
<first>Johnny</first>
<salary>95000</salary>
</employee>
<employee hireDate="08/20/2000">
<last>Hill</last>
<first>Graham</first>
<salary>89000</salary>
</employee>
</employees>


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>


<xsl:strip-space elements="*"/>


<xsl:template match="employees">
Last First Salary Hire Date
---- ----- ------ ----------
<xsl:apply-templates/>
</xsl:template>


<xsl:template match="employee">
<xsl:apply-templates select="last"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="first"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="salary"/>
<xsl:text> </xsl:text>
<xsl:apply-templates select="@hireDate"/><xsl:text>
</xsl:text>
</xsl:template>


</xsl:stylesheet>


Compilation result:
C:\fop>java -Xmx256m -cp build\fop.jar;lib\batik.jar;lib\xalan-2.0.0.jar;lib\xer
ces-1.2.3.jar;lib\avalon-framework-4.0.jar;lib\logkit-1.0.jar;lib\jimi-1.0.jar o
rg.apache.fop.apps.Fop -c conf\userconfig.xml -d -xsl AddTab.xsl -xml AddTab.xml
-txt AddTab.txt
[DEBUG]: Input mode:
[DEBUG]: xslt transformation
[DEBUG]: xml input file: AddTab.xml
[DEBUG]: xslt stylesheet: AddTab.xsl
[DEBUG]: Output mode:
[DEBUG]: txt
[DEBUG]: output file: AddTab.txt
[DEBUG]: OPTIONS
[DEBUG]: user configuration file: conf\userconfig.xml
[DEBUG]: debug mode on
[DEBUG]: dump configuration
[DEBUG]: quiet mode on
[DEBUG]: reading user configuration file
[DEBUG]: base directory: file:/C:/fop/
[INFO]: FOP 0.20.3
[DEBUG]: using SAX parser org.apache.xerces.parsers.SAXParser
[INFO]: building formatting object tree
[DEBUG]: setting up fonts
[INFO]: rendering areas to TEXT
[INFO]: Parsing of document complete, stopping renderer
[INFO]: writing out TEXT
[DEBUG]: Initial heap size: 913Kb
[DEBUG]: Current heap size: 740Kb
[DEBUG]: Total memory used: -173Kb
[DEBUG]: Memory use is indicative; no GC was performed
[DEBUG]: These figures should not be used comparatively
[DEBUG]: Total time used: 110ms
[DEBUG]: Pages rendererd: 0
[INFO]: Parsing of document complete, stopping renderer
[INFO]: writing out TEXT
[DEBUG]: Initial heap size: 913Kb
[DEBUG]: Current heap size: 755Kb
[DEBUG]: Total memory used: -157Kb
[DEBUG]: Memory use is indicative; no GC was performed
[DEBUG]: These figures should not be used comparatively
[DEBUG]: Total time used: 125ms
[DEBUG]: Pages rendererd: 0
[ERROR]: / by zero
org.apache.fop.apps.FOPException: / by zero
at org.apache.fop.apps.Driver.render(Driver.java:486)
at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72
)
at org.apache.fop.apps.Fop.main(Fop.java:19)


---------


javax.xml.transform.TransformerException: / by zero
at org.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java:137)
at org.apache.fop.apps.Driver.render(Driver.java:481)
at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:72
)
at org.apache.fop.apps.Fop.main(Fop.java:19)


---------


javax.xml.transform.TransformerException: / by zero
at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
rImpl.java:1212)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java
:2894)
at java.lang.Thread.run(Unknown Source)
---------
java.lang.ArithmeticException: / by zero
at org.apache.fop.apps.StreamRenderer.stopRenderer(StreamRenderer.java:171)
at org.apache.fop.fo.FOTreeBuilder.endDocument(FOTreeBuilder.java:205)
at org.apache.xalan.transformer.ResultTreeHandler.endDocument(ResultTreeHandler.java:180)
at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1194)
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java
:2894)
at java.lang.Thread.run(Unknown Source)


Any userconfig related?


Regards,
Eddie
(htcheng@hongkong.com)


No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Compilation Error occur with the add tab example
    2003-01-21 07:53:37 Bob DuCharme [Reply]

    After saving the source document in temp.xml and the stylesheet in temp.xsl, the following command line worked fine for me Using Xalan Java 2.0.0, so it must be a problem with the interaction of the various class libraries used when compiling:


    java org.apache.xalan.xslt.Process -in temp.xml -xsl temp.xsl -out temp.out


    Bob






Sponsored By: