title: How to print array in pdf using xsl FO
body: <p>I have a collection of objects which i want to print to pdf in a templated format.
  I have tried to print the collection as PDF using the code below, but i do not see any text rendered in PDF after file is created.</p>
  
  <p>The java code is as follows:</p>
  
  <pre><code>FopFactory fopFactory = FopFactory.newInstance();
  OutputStream out = new BufferedOutputStream(new FileOutputStream(new File("/home/myfile.pdf")));
  try {
  Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
  TransformerFactory factory = TransformerFactory.newInstance();
  Transformer transformer = factory.newTransformer(); 
      Eden[] ed=new Eden[3];
      for(int i=0;i&lt;ed.length;i++)
      {
          ed[i]=new Eden();
      ed[i].setBlow(String.valueOf(i));
      }
  Source src = new StreamSource(new File("/home/tables.fo"));
  Result res = new SAXResult(fop.getDefaultHandler());
  transformer.setParameter("dep", ed);
  transformer.transform(src, res);
  } finally {
  out.close();
  }
  </code></pre>
  
  <p>The fo file is as follows:</p>
  
  <pre><code>&lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" 
   xmlns:xsl="http://www.w3.org    /1999/XSL/Transform"&gt;
     &lt;fo:layout-master-set&gt;
      &lt;fo:simple-page-master master-name="my-page"&gt;
    &lt;fo:region-body margin="0.5in"/&gt;
  &lt;/fo:simple-page-master&gt;
   &lt;/fo:layout-master-set&gt;
    &lt;fo:page-sequence master-reference="my-page"&gt;
   &lt;fo:flow flow-name="xsl-region-body" font="7pt Times"&gt;
      &lt;fo:block border="thin solid black" text-align="center"&gt;
      &lt;xsl:for-each select="dep"&gt;
          {$blow}
      &lt;/xsl:for-each&gt;
  &lt;/fo:block&gt;
   &lt;/fo:flow&gt;
    &lt;/fo:page-sequence&gt;
  &lt;/fo:root&gt;
  </code></pre>