Hi all,

I am new to XSL FO and have been working through some tutorials.

I have successfully managed to create the Fop font xml files and
config.xml file for the folder, and have setup cocoons sitemap so the
fo2pdf serializer find the config file. 

However the problem comes when I try to parse simple XML through an XSL
template and serialize it as PDF. I think the error lies in my XSL
however after following several examples to the letter I'm tearing my
hair out! The XML, XSL and Error are outlined below:

<!--++++++++++++++++++++++++++++++++++++++++++++++++-->
<!-- Sample simple XML below : -->
<?xml version="1.0"?>
<page>
  <main>
    <item>
      <title>HELLO WORLD!</title>
      <body>PDF is getting on my wick</body>
    </item>
  </main>
</page>

<!--++++++++++++++++++++++++++++++++++++++++++++++++-->
<!-- Sample XSL below : -->
<?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";>

  <xsl:template match="/">

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

      <fo:layout-master-set>
        <fo:simple-page-master master-name = "first">
          <fo:region-body margin-top="1in"
                          margin-bottom="1in"
                          margin-left="1.5in"
                          margin-right="1.5in"/>
          <fo:region-before extent="1in"
                            margin-top="0.2in"
                            margin-bottom="0.2in"
                            margin-left="0.2in"
                            margin-right="0.2in"/>
        </fo:simple-page-master>

        <fo:page-sequence-master master-name = "run1">
          <fo:single-page-master-reference 
                          master-name = "first"/>
        </fo:page-sequence-master>

      </fo:layout-master-set>

      <fo:page-sequence master-name = "run1">   
        <xsl:apply-templates/>
      </fo:page-sequence>

    </fo:root>

  </xsl:template>
  
  <xsl:template match="page">

    <fo:static-content flow-name="xsl-region-before">
      <fo:block font-size="10pt"
                line-height="12pt"
                font-family="Arial"
                text-align="center">
        Page <fo:page-number/>
      </fo:block>
    </fo:static-content>

    <fo:flow flow-name="xsl-body">
      <xsl:for-each select="main/item">

        <fo:block font-size="10pt"
                  line-height="12pt"
                  font-family="Arial"
                  text-align="center"
                  font-weight="bold">
          <xsl:value-of select="title"/>
        </fo:block>

        <fo:block font-size="10pt"
                  line-height="12pt"
                  font-family="Arial"
                  text-align="center">
          <xsl:value-of select="body"/>
        </fo:block>
 
      </xsl:for-each>     
    </fo:flow>
    
  </xsl:template>

</xsl:stylesheet>

<!--++++++++++++++++++++++++++++++++++++++++++++++++-->
<!-- Print of the error below : -->
<!-- This error is generated by the tomcat window-->
java.lang.RuntimeException: Errors in XSLT transformation:
Fatal: org.apache.for.apps.FOPException: 'master-referance' for
'fo:page-sequence matches no 'simple-page-master' or
'page-sequence-master'

   at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:31
70)
   at java.lang.Thread.run(Thread.java:536)

<!--++++++++++++++++++++++++++++++++++++++++++++++++-->

The error I get from Acrobat in "File damaged!"

If anyone can spot the error it would be most appreciated however as I
say this has been copied CLOSELY from a textbook so I'm at a loss

Cheers

Tom Place
 



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to