cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manpreet" <manpreetnag...@yahoo.com>
Subject fo problem !!
Date Wed, 23 Aug 2000 11:31:00 GMT
Hi Everybody,

Im trying to display an xml document as  pdf  for which I applied an xsl to it.
I get the  following error:
java.lang.Exception: No formatter for type ""
	at org.apache.cocoon.formatter.FormatterFactory.getFormatterForType(FormatterFactory.java,
Compiled Code)
	at org.apache.cocoon.formatter.FormatterFactory.getFormatter(FormatterFactory.java, Compiled
Code)
	at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
	at org.apache.cocoon.Cocoon.service(Cocoon.java, Compiled Code)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
	at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled Code)
	at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
Compiled Code)
	at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, Compiled Code)
	at java.lang.Thread.run(Thread.java, Compiled Code)

here are the rwo files:

book.xml

<?xml version="1.0"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="book.xsl" type="text/xsl"?>

<book>
 <cover>
  <title> Java And Xml </title>
  <author> Brett McLaughlin </author>
 </cover>

 <contents>
  <chapter id="chapterOne">
  <title>Chapter 1: Introduction </title>

  <paragraph>These three letters have brought shivers to the almost every developer
in the world today at some point in the last two years.
  </paragraph>
  <paragraph>Today&apos;s web application now faces a wealth of problems that we
not even considered ten years ago.
  </paragraph>
  
  </chapter>
 </contents>
</book> 


book.xsl

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="book">
 <xsl:processing-instruction name="cocoon-format">
  type=""text/xslfo"
 </xsl:processing-instruction> 
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>
   <fo:simple-page-master
   page-master-name="right"
   margin-top="75pt"
   margin-bottom="25pt"
   margin-left="100pt"
   margin-right="50pt">
     <fo:region-body margin-bottom="50pt"/>
     <fo:region-after extent="25pt"/>
   </fo:simple-page-master>
   <fo:simple-page-master
    page-master-name="left"
  margin-top="75pt"
  margin-bottom="25pt"
  margin-left="100pt"
  margin-right="50pt">
    <fo:region-body margin-bottom="50pt"/>
  <fo:region-after extent="25pt"/>
   </fo:simple-page-master>
  </fo:layout-master-set>

  <fo:page-sequence>
    <fo:sequence-specification>
      <fo:sequence-specifier-alternating
        page-master-first="right"
        page-master-odd="right"
        page-master-even="left"/>
     </fo:sequence-specification>

     <fo:static-content flow-name="xsl-after">
      <fo:block text-align-last="centered" font-size="10pt">
  <fo:page-number/>
  </fo:block>
     </fo:static-content>

     <fo:flow>
      <xsl:apply-templates/>
     </fo:flow>
  </fo:page-sequence>

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

<xsl:template match="cover/title">
    <fo:block font-size="36pt" text-align-last="centered" space-before.optimum="24pt">
 <xsl:apply-templates/>
 </fo:block>
</xsl:template>

<xsl:template match="author">
 <fo:block font-size="24pt" text-align-last="centered" space-before.optimum="24pt">
 <xsl:apply-templates/>
 </fo:block>
</xsl:template>


<xsl:template match="chapter">
 <xsl:apply-templates/>
</xsl:template>

<xsl:template match="chapter/title">
 <fo:block font-size="24pt" text-align-last="centered" space-before.optimum="24pt">
 <xsl:apply-templates/>
 </fo:block>
</xsl:template>

<xsl:template match="paragraph">
 <fo:block font-size="12pt" space-before.optimum="12pt" text-align="justified">
 <xsl:apply-templates/>
 </fo:block>
</xsl:template>

</xsl:stylesheet> 


Thanks in advance for your time ,

Manpreet Singh.




Mime
View raw message