You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Rohini Vashisht <va...@marketingcomm.com> on 2000/06/23 01:06:46 UTC

FOP error - XTCommandLine

I would appreciate any help with this issue. Thank you in advance.
 
I have downloaded and installed the latest version of fop from http://xml.apache.org/fop.  I am trying to use fop to convert XML files to pdf. I am getting this error while running XTCommandLine:
 
FOP 0.12.2 [dev]
using renderer org.apache.fop.render.pdf.PDFRenderer
using element mapping org.apache.fop.fo.StandardElementMapping
using element mapping org.apache.fop.svg.SVGElementMapping
building formatting object tree
WARNING: Unknown formatting object ^html
FATAL ERROR: Root element must be root, not default FO


The error seems to arise since the application expects an fo file to be created as a result of applying the xsl file to the xml file.

The XML file is as follows:
<?xml version="1.0"?>
<PERIODIC_TABLE>
 
  <ATOM STATE="GAS">
    <NAME>Hydrogen</NAME>
    <SYMBOL>H</SYMBOL>    
    <ATOMIC_NUMBER>1</ATOMIC_NUMBER>
    <ATOMIC_WEIGHT>1.00794</ATOMIC_WEIGHT>
    <BOILING_POINT UNITS="Kelvin">20.28</BOILING_POINT>
    <MELTING_POINT UNITS="Kelvin">13.81</MELTING_POINT>
    <DENSITY UNITS="grams/cubic centimeter"><!-- At 300K -->
      0.0899
    </DENSITY>
  </ATOM>
 
  <ATOM STATE="GAS">
    <NAME>Helium</NAME>
    <SYMBOL>He</SYMBOL>    
    <ATOMIC_NUMBER>2</ATOMIC_NUMBER>
    <ATOMIC_WEIGHT>4.0026</ATOMIC_WEIGHT>
    <BOILING_POINT UNITS="Kelvin">4.216</BOILING_POINT>
    <MELTING_POINT UNITS="Kelvin">0.95</MELTING_POINT>
    <DENSITY UNITS="grams/cubic centimeter"><!-- At 300K -->
      0.1785
    </DENSITY>
  </ATOM>
  
</PERIODIC_TABLE>
 
The XSL file is as follows:
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <xsl:template match="PERIODIC_TABLE">
    <html>
      <xsl:apply-templates/>
    </html>
  </xsl:template>
  
  <xsl:template match="ATOM">
    <P>
      <xsl:apply-templates/>
    </P>
  </xsl:template>
  
</xsl:stylesheet>
 

Thank you for the help,
Thank you,
Rohini



Re: FOP error - XTCommandLine

Posted by Richard Light <ri...@light.demon.co.uk>.
In message <00...@vashishr-ws>, Rohini Vashisht
<va...@marketingcomm.com> writes
>    I would appreciate any help with this issue. Thank you in advance.
>     
>    I have downloaded and installed the latest version of fop from 
>    http://xml.apache.org/fop.  I am trying to use fop to convert XML 
>    files to pdf. I am getting this error while running XTCommandLine:
>     
>    FOP 0.12.2 [dev]
>    using renderer org.apache.fop.render.pdf.PDFRenderer
>    using element mapping org.apache.fop.fo.StandardElementMapping
>    using element mapping org.apache.fop.svg.SVGElementMapping
>    building formatting object tree
>    WARNING: Unknown formatting object ^html
>    FATAL ERROR: Root element must be root, not default FO
>     
>    The error seems to arise since the application expects an fo file 
>    to be created as a result of applying the xsl file to the xml file.

That's precisely right.  FOP expects to be given a style sheet which
will convert the XML source document into another XML document
consisting of 'formatting objects'.  These formatting objects are
defined in the W3C's XSL draft Formatting standard
(http://www.w3.org/Style/XSL), although FOP seems to have an affinity
for an earlier draft, dated April 1999.

FOP has no idea what to do with HTML, which is what your style sheet is
producing for it.

Richard Light.

Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk


Re: FOP error - XTCommandLine

Posted by Fotis Jannidis <Fo...@lrz.uni-muenchen.de>.
You are using a stylesheet written to output a html file (looks like the examples Harold 
used in his XML Bible), but your stylesheet must transform your xml document into a 
flow objects file conforming to the xsl:fo specification. Maybe a look at the examples in 
the fop distribution can give you a hint how such a file must look like. If your are reading 
Harolds book and not only the online version you should have a look at chapter 15.
Fotis

> I would appreciate any help with this issue. Thank you in advance. I have downloaded
> and installed the latest version of fop from http://xml.apache.org/fop.  I am trying
> to use fop to convert XML files to pdf. I am getting this error while running
> XTCommandLine: FOP 0.12.2 [dev] using renderer org.apache.fop.render.pdf.PDFRenderer
> using element mapping org.apache.fop.fo.StandardElementMapping using element mapping
> org.apache.fop.svg.SVGElementMapping building formatting object tree WARNING: Unknown
> formatting object ^html FATAL ERROR: Root element must be root, not default FO 
> 
> 
> The error seems to arise since the application expects an fo file to be created as a result of applying the xsl file to the xml file.
> 
> The XML file is as follows:
> <?xml version="1.0"?>
> <PERIODIC_TABLE>
>  
>   <ATOM STATE="GAS">
>     <NAME>Hydrogen</NAME>
>     <SYMBOL>H</SYMBOL>    
>     <ATOMIC_NUMBER>1</ATOMIC_NUMBER>
>     <ATOMIC_WEIGHT>1.00794</ATOMIC_WEIGHT>
>     <BOILING_POINT UNITS="Kelvin">20.28</BOILING_POINT>
>     <MELTING_POINT UNITS="Kelvin">13.81</MELTING_POINT>
>     <DENSITY UNITS="grams/cubic centimeter"><!-- At 300K -->
>       0.0899
>     </DENSITY>
>   </ATOM>
>  
>   <ATOM STATE="GAS">
>     <NAME>Helium</NAME>
>     <SYMBOL>He</SYMBOL>    
>     <ATOMIC_NUMBER>2</ATOMIC_NUMBER>
>     <ATOMIC_WEIGHT>4.0026</ATOMIC_WEIGHT>
>     <BOILING_POINT UNITS="Kelvin">4.216</BOILING_POINT>
>     <MELTING_POINT UNITS="Kelvin">0.95</MELTING_POINT>
>     <DENSITY UNITS="grams/cubic centimeter"><!-- At 300K -->
>       0.1785
>     </DENSITY>
>   </ATOM>
>   
> </PERIODIC_TABLE>
>  
> The XSL file is as follows:
> <?xml version="1.0"?> 
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  
>   <xsl:template match="PERIODIC_TABLE">
>     <html>
>       <xsl:apply-templates/>
>     </html>
>   </xsl:template>
>   
>   <xsl:template match="ATOM">
>     <P>
>       <xsl:apply-templates/>
>     </P>
>   </xsl:template>
>   
> </xsl:stylesheet>
>  
> 
> Thank you for the help,
> Thank you,
> Rohini
> 
> 
>