You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2010/10/21 16:01:59 UTC

svn commit: r1026003 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java

Author: jeremias
Date: Thu Oct 21 14:01:59 2010
New Revision: 1026003

URL: http://svn.apache.org/viewvc?rev=1026003&view=rev
Log:
Allow to pass through document-level extensions from the first document passed to the IFConcatenator.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java?rev=1026003&r1=1026002&r2=1026003&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/util/IFConcatenator.java Thu Oct 21 14:01:59 2010
@@ -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.intermediat
  * <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} */



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org