public static void transform(StreamSource src,StreamSource stylesheet,Fop fop) throws FOPException {
  Result res=new SAXResult(fop.getDefaultHandler());
  try {
    TransformerFactory factory=TransformerFactory.newInstance();
    Transformer transformer;
    if (stylesheet == null) {
      transformer=factory.newTransformer();
    }
 else {
      transformer=factory.newTransformer(stylesheet);
    }
    transformer.setURIResolver(new LocalResolver(transformer.getURIResolver()));
    transformer.transform(src,res);
  }
 catch (  Exception e) {
    throw new FOPException(e);
  }
}

public static void transform ( StreamSource src , StreamSource stylesheet , Fop fop ) throws FOPException { Result res = new SAXResult ( fop . getDefaultHandler ( ) ) ; try { TransformerFactory factory = TransformerFactory . newInstance ( ) ; Transformer transformer ; if ( stylesheet == null ) { transformer = factory . newTransformer ( ) ; } else { transformer = factory . newTransformer ( stylesheet ) ; } transformer . setURIResolver ( new LocalResolver ( transformer . getURIResolver ( ) ) ) ; transformer . transform ( src , res ) ; } catch ( Exception e ) { throw new FOPException ( e ) ; } }
transform an xsl - fo streamsource to the specified output format .
