4917Re: [XSL-FO] Applying a XML transformation before creating the PDF (FOP)
- Feb 10, 2004armin.keyvanloo@... wrote:
> I need to apply a transformation to the source XML to strip out some of theFirst, check whether FOP really uses Saxon. If you use JDK 1.4,
> elements from it before feeding it into FOP to create the PDF.
> I don't know how to chain the XSL's for fop. I tried using Saxon's
> next-in-chain attribute like this(transformer.xsl) by having 2 XSL's one is
> transform and one to create the PDF. I called the transformer XSL 1st (in
> the source XSL on FOP) and then use the next-in-chain to trigger the PDF
it is more likely you are actually using the Xalan included in
the JDK, which wont recognize the extension.
If you really use Saxon, it is quite possible that the method
how the PDF renderer is docked onto the XSLT transformer also
ignores the required second transformation. Some possible
1. Do both transformations in the same style sheet. Save the
result from the first transformation into a variable, and
apply the second. Use modes for the tempaltes:
<!-- start here -->
<xsl:apply-templates select="." mode="pass1"/>
<xsl:template match="/" mode="pass1">
.... pass 1 stuff ...
<xsl:template match="/" mode="pass2">
You'll have to declare the saxon namespace in order to get the
node-set() extension function working.
2. Use Saxon's FOP chaining in the second XSLT. Check the Saxon
documentation and perhaps the Saxon user list for details.
3. Write a Java wrapper for both the transformations and FOP.
and use the link to the source code.
Adding another transformation is a bit tricky, you'll have to
check the documentation for SAXTransformerHandler and
SAXTransformerFactory because one of the transformations has to
be created as SAX filter.
4. Use Cocoon:
- << Previous post in topic Next post in topic >>