Hi all,
I've tryed to embed FOP-0.18.1DEV with a servlet so that to render (xml,xsl)
files into PDF. I am using Tomcat 3.2.1 as web container. 

Unfortunately, the call of the servlet works from Netscape Navigator 
and renders PDF. However, it doesn't work from Internet Explorer. in fact
with IE, the process ends with a black page in the browser despite the well
processing in Tomcat console ( all debuging info which are displayed with
the netscape call are displayed too with IE call)

you will find attached the servlet code, the xml, xsl file and the html file
which allow to call the servlet.


please help,
Sincerly, adel





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/

PDFGeneratorServlet.java

Title: Afficher PDF

This is my first page

To vew PDF, try this link

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

<!--================================================================-->
<!-- Root Element Template                                          -->
<!-- This template specifies what creates the root element of the   -->
<!-- result tree.  In this case, it tells the XSL processor to      -->
<!-- start with the <letter> element.                               -->
<!--================================================================-->

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

<!--================================================================-->
<!-- <letter> template                                              -->
<!-- This template takes the letter element and processes its       -->
<!-- contents.                                                      -->
<!--================================================================-->

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

<!--================================================================-->
<!-- Cocoon processing instruction                                  -->
<!-- This processing instruction lets us serve an XML document as a -->
<!-- PDF.  The Cocoon servlet uses this instruction to invoke FOP   -->
<!-- automatically.                                                 -->
<!--================================================================-->

    <xsl:processing-instruction 
      name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>

<!--================================================================-->
<!-- The fo:root element contains the entire document.              -->
<!--================================================================-->

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

<!--================================================================-->
<!-- The layout-master-set defines a set of page layouts.  For our  -->
<!-- purposes here, we only need one.                               -->
<!--================================================================-->

      <fo:layout-master-set>
        <fo:simple-page-master
          page-master-name="main"
          margin-top="75pt"
          margin-bottom="75pt"
          margin-left="75pt"
          margin-right="75pt">

<!--================================================================-->
<!-- The region-body element is where all the action is.  We'll put -->
<!-- all of our content into this space.                            -->
<!--================================================================-->

          <fo:region-body margin-bottom="75pt"/>
        </fo:simple-page-master>
      </fo:layout-master-set>

<!--================================================================-->
<!-- Our next step is to define the page styles used.  We can       -->
<!-- different page styles for the first page, odd pages, and even  -->
<!-- pages.  They're all the same for this simple document.         -->
<!--================================================================-->

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

<!--================================================================-->
<!-- Finally, we'll put everything into a flow element.             -->
<!--================================================================-->

        <fo:flow>

<!--================================================================-->
<!-- To get the formatting we want, we'll put the content in a block-->
<!--================================================================-->

     <fo:block font-size="12pt" line-height="15pt" 
      text-align="start" space-after.optimum="24pt">
      <xsl:value-of select="title"/>  
      <xsl:value-of select="content/paragraph"/>		
     </fo:block>
          
    </fo:flow>
   </fo:page-sequence>
  </fo:root>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" ?>
<?xml-stylesheet href="hello.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<page>
 <title>Hello</title>
 <content>
  <paragraph>This is my first page!</paragraph>
 </content>
</page>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to