I'm using fop-1.0 compile a year or so ago.  Perhaps I just need to
download the trunk?  Certainly happy to do that given a glimmer of hope
that it will solve my problem.

I think I've hit a catch-22 when generating IF
(application/X-fop-areatree) output. To generate this format I believe
one is forced to use "factory.newTransformer.transform(xsltSource)" as
opposed to the no-arg constructor.  And once one has done that one
cannot use transformer.setParameter(key, value).

This makes using <xsl:param> in the IF-generating style-sheet neigh
impossible. Or I'm off my rocker (again).


            Transformer transformer = null;
            TransformerFactory factory = TransformerFactory.newInstance();

            if (xsltSource == null) {
                // Not generating IF
                transformer = factory.newTransformer();
            }
            else {
                // Generating IF, xsltSource is
                transformer = factory.newTransformer(xsltSource);
            }
            if (xsltParameterMap != null) {
                // The values in the map are not applied when making IF
                // I suspect because the stylesheet has already been read
                applyXsltParameterMap(transformer); //Iterates on map:
transformer.setParameter(k,v)
            }
            transformer.transform(src, result);
            resultBytes = out.toByteArray();

Where xsltSource is constructed via

            xslUrl = new URL("jar:file://" + getBundlePath() +
                              "/lib/book-printing-core.jar!/" +
xsltFilename); // <== something.xsl
            inputstream = xslUrl.openStream();
            BufferedInputStream bis = new BufferedInputStream(inputstream);
           
            xsltSource = new StreamSource(bis);

If I don't use the second form of the constructor (with stylesheet) I do
not get the IF.  Indeed it's an error condition because the transformer
expect fo not xsl as the source.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

Reply via email to