title: Pass a parameter from java-embedded fop to xsl file
body: <p>I've embedded fop in a java programm:</p>
  
  <pre><code>public class run {
  
   public static void main(String [ ] args){
  
      FopFactory fopFactory = FopFactory.newInstance();
  
      OutputStream out = null;
      try {
          out = new BufferedOutputStream(new FileOutputStream(new File("F:/test.pdf")));
      } catch (FileNotFoundException e) {
  
          e.printStackTrace();
      }
  
      try {
        Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
  
        TransformerFactory factory = TransformerFactory.newInstance();
        Source xslt = new StreamSource(new File("F:/main_structure.xsl"));
        Transformer transformer = factory.newTransformer(xslt);
  
        Source src = new StreamSource(new File("F:/source.xml"));
  
        Result res = new SAXResult(fop.getDefaultHandler());
  
        transformer.transform(src, res);
  
      } catch (FOPException e) {
          e.printStackTrace();
      } catch (TransformerConfigurationException e) {
          e.printStackTrace();
      } catch (TransformerException e) {
          e.printStackTrace();
      } finally {
        try {
          out.close();
          System.out.println("ende");
      } catch (IOException e) {
          e.printStackTrace();
      }
      }
   }
  }
  </code></pre>
  
  <p>now my xsl (main_structure.xsl) needs a parameter to run</p>
  
  <pre><code>    &lt;xsl:param name="OFFSET_LEFT" select="1"/&gt;
  </code></pre>
  
  <p>in the console I would be using the "-param name value" attribute to pass that parameter to fop.</p>
  
  <p>So how do I pass a parameter into my xsl file in the embedded version of fop?</p>