diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-10-21 14:01:59 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-10-21 14:01:59 +0000 |
commit | e7e29079203c8f847be894289e9bc177fba06cd8 (patch) | |
tree | c9ee5fc771dfd7a79d6dd0d518afeb8287f375e9 | |
parent | c7f63f3f3a9d864e4da0940ad1d0dbf7a60f558a (diff) | |
download | xmlgraphics-fop-e7e29079203c8f847be894289e9bc177fba06cd8.tar.gz xmlgraphics-fop-e7e29079203c8f847be894289e9bc177fba06cd8.zip |
Allow to pass through document-level extensions from the first document passed to the IFConcatenator.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1026003 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java b/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java index 4b0a3fe68..71ee7a0b0 100644 --- a/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java +++ b/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java @@ -19,7 +19,6 @@ package org.apache.fop.render.intermediate.util; - import java.awt.Dimension; import javax.xml.transform.Source; @@ -39,12 +38,17 @@ import org.apache.fop.render.intermediate.IFParser; * <p> * Note: This class will filter/ignore any document navigation events. Support for this may be * added later. + * <p> + * Note: document-level extensions will only be transferred from the first document passed in. + * If you need to merge extensions from all the concatenated documents, you may have to merge + * these manually on the XML level, for example using XSLT. */ public class IFConcatenator { private IFDocumentHandler targetHandler; private int nextPageIndex = 0; + private boolean inFirstDocument = true; /** * Creates a new IF concatenator. @@ -163,14 +167,17 @@ public class IFConcatenator { /** {@inheritDoc} */ public void endDocument() throws IFException { //ignore + inFirstDocument = false; } /** {@inheritDoc} */ public void handleExtensionObject(Object extension) throws IFException { - if (inPageSequence) { + if (inPageSequence || inFirstDocument) { //Only pass through when inside page-sequence + //or for the first document (for document-level extensions). super.handleExtensionObject(extension); } + //Note:Extensions from non-first documents are ignored! } /** {@inheritDoc} */ |