xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From normbish...@netscape.net
Subject FOP error with <xsl:copy-of .../>
Date Tue, 04 Jun 2002 17:34:12 GMT

  I am attaching the test xsl,xml and the java files.  The problem is that the description
of any node could have tags and text mixed.  If I use <xsl:value-of> (with FOP), I get
  the text and when I use <xsl:copy-of> (without FOP embeded), I get the desired result,
but with FOP I am getting 'error 10231'   I have tried everything that I could think of and
could not come up with the correct stylesheet.  
  I truly could use your help!!!!
  I am anxiously waiting for a solution.

  Thank you so much in advance.

  --- ERROR ---------
  ERROR   10231   [fop     ] (): Unknown formatting object null^chapter_title
  Exception in thread "main" org.apache.fop.apps.FOPException: java.lang.NullPoin
         at org.apache.fop.apps.Driver.render(Driver.java:486)
         at test1.main(test1.java:102)

  -------------------- test.xml ----------------------------------
  <?xml version="1.0" encoding="iso-8859-1"?>
  <?xml-stylesheet type='text/xsl' href='test.xsl'?>
  <document id="DOCUMENT 810-005_103">
     <chapter id="test">
         <chapter_title>Testing Chapter <sub>3</sub></chapter_title>

  ------------------  test.xsl ---------------------------
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    <xsl:template match="document">
     <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">  
         <fo:simple-page-master page-width="200mm" master-name="Page1" page-height="280mm"
  margin-top="10mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm">
           <fo:region-body margin-top="0mm" margin-bottom="10mm"
                        margin-left="0mm" margin-right="0mm"/>
         <fo:page-sequence-master master-name="PS1">
           <fo:single-page-master-reference master-name="Page1"/>
       <fo:page-sequence  master-reference="Page1">
         <fo:flow  flow-name="xsl-region-body"> 
         </fo:flow >
       </fo:page-sequence >      
  <xsl:template match="document/chapter/chapter_title">
         <fo:block space-after="3mm" font-size="14pt" text-align="center" break-before="page"
           <xsl:copy-of select="."/>

  --------------- test.java file just the main()----------------
  public static void main () {    

             File xmlFile=new File("test.xml");
             File xslFile=new File("test.xsl");
             File pdfFile=new File("test.pdf");

             Logger log = null;

               if(log == null) {
                 Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
                 log = hierarchy.getLoggerFor("fop");
                     FileOutputStream OutFile = new FileOutputStream(pdfFile);
                     ByteArrayOutputStream out = new ByteArrayOutputStream();
                     Driver driver=new Driver();
                     InputHandler ih=new XSLTInputHandler(xmlFile,xslFile);
                     XMLReader p=ih.getParser();
                     driver.render(p, ih.getInputSource());

Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience
of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

View raw message