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 vh...@apache.org on 2013/04/08 13:51:53 UTC

svn commit: r1465599 [1/2] - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/accessibility/ src/java/org/apache/fop/accessibility/fo/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/extensions/ src/java/org/apache/fop/fo/extensions/destinatio...

Author: vhennebert
Date: Mon Apr  8 11:51:52 2013
New Revision: 1465599

URL: http://svn.apache.org/r1465599
Log:
FOP #2234: NPE when rendering a document with markers and accessibility is enabled

Added:
    xmlgraphics/fop/trunk/test/pdf/accessibility/markers.fo   (with props)
    xmlgraphics/fop/trunk/test/pdf/accessibility/pdf/markers.pdf   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/DummyStructureTreeEventHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTreeEventHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/StructureTreeEventTrigger.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/DelegatingFOEventHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObjMixed.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/destination/Destination.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BasicLink.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Block.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Character.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Float.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Footnote.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FootnoteBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Inline.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InlineContainer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Leader.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListBlock.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItem.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemLabel.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiProperties.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiSwitch.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumber.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Wrapper.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/Table.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCaption.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCell.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableRow.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Declarations.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Flow.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Root.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/StaticContent.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFStructElem.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPInvokeMediumMapElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlayElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AFPPageSetupElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/extensions/AbstractAFPExtensionObject.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFParser.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFSerializer.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/intermediate/IFStructureTreeBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/render/intermediate/IFStructureTreeBuilderTestCase.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/DummyStructureTreeEventHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/DummyStructureTreeEventHandler.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/DummyStructureTreeEventHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/DummyStructureTreeEventHandler.java Mon Apr  8 11:51:52 2013
@@ -42,7 +42,7 @@ public final class DummyStructureTreeEve
     }
 
     /** {@inheritDoc} */
-    public StructureTreeElement startNode(String name, Attributes attributes) {
+    public StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent) {
         return null;
     }
 
@@ -51,12 +51,12 @@ public final class DummyStructureTreeEve
     }
 
     /** {@inheritDoc} */
-    public StructureTreeElement startImageNode(String name, Attributes attributes) {
+    public StructureTreeElement startImageNode(String name, Attributes attributes, StructureTreeElement parent) {
         return null;
     }
 
     /** {@inheritDoc} */
-    public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
+    public StructureTreeElement startReferencedNode(String name, Attributes attributes, StructureTreeElement parent) {
         return null;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java Mon Apr  8 11:51:52 2013
@@ -87,7 +87,7 @@ public final class StructureTree2SAXEven
     }
 
     /** {@inheritDoc} */
-    public StructureTreeElement startNode(String name, Attributes attributes) {
+    public StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent) {
         try {
             if (name.equals("#PCDATA")) {
                 name = "marked-content";
@@ -115,13 +115,13 @@ public final class StructureTree2SAXEven
     }
 
     /** {@inheritDoc} */
-    public StructureTreeElement startImageNode(String name, Attributes attributes) {
-        return startNode(name, attributes);
+    public StructureTreeElement startImageNode(String name, Attributes attributes, StructureTreeElement parent) {
+        return startNode(name, attributes, null);
     }
 
     /** {@inheritDoc} */
-    public StructureTreeElement startReferencedNode(String name, Attributes attributes) {
-        return startNode(name, attributes);
+    public StructureTreeElement startReferencedNode(String name, Attributes attributes, StructureTreeElement parent) {
+        return startNode(name, attributes, null);
     }
 
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTreeEventHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTreeEventHandler.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTreeEventHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/StructureTreeEventHandler.java Mon Apr  8 11:51:52 2013
@@ -43,9 +43,11 @@ public interface StructureTreeEventHandl
      *
      * @param name the name of the structure tree node
      * @param attributes the node properties
+     * @param parent the parent of the node. May be null, in which case the parent node is
+     * the node corresponding to the previous call to this method
      * @return the corresponding structure tree element
      */
-    StructureTreeElement startNode(String name, Attributes attributes);
+    StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent);
 
     /**
      * Ends a structure tree node.
@@ -59,9 +61,11 @@ public interface StructureTreeEventHandl
      *
      * @param name the name of the structure tree node
      * @param attributes the node properties
+     * @param parent the parent of the node. May be null, in which case the parent node is
+     * the node corresponding to the previous call to this method
      * @return the corresponding structure tree element
      */
-    StructureTreeElement startImageNode(String name, Attributes attributes);
+    StructureTreeElement startImageNode(String name, Attributes attributes, StructureTreeElement parent);
 
     /**
      * Starts a node that can be referenced by other nodes. This is usually a
@@ -69,9 +73,11 @@ public interface StructureTreeEventHandl
      *
      * @param name the name of the structure tree node
      * @param attributes the node properties
+     * @param parent the parent of the node. May be null, in which case the parent node is
+     * the node corresponding to the previous call to this method
      * @return the corresponding structure tree element
      */
-    StructureTreeElement startReferencedNode(String name, Attributes attributes);
+    StructureTreeElement startReferencedNode(String name, Attributes attributes, StructureTreeElement parent);
 
     /**
      * Ends a page sequence structure tree node.

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java Mon Apr  8 11:51:52 2013
@@ -19,6 +19,8 @@
 
 package org.apache.fop.accessibility.fo;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Stack;
 
 import org.xml.sax.SAXException;
@@ -29,6 +31,7 @@ import org.apache.fop.fo.DelegatingFOEve
 import org.apache.fop.fo.FOEventHandler;
 import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.extensions.ExternalDocument;
+import org.apache.fop.fo.flow.AbstractRetrieveMarker;
 import org.apache.fop.fo.flow.BasicLink;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.BlockContainer;
@@ -46,6 +49,8 @@ import org.apache.fop.fo.flow.ListItemLa
 import org.apache.fop.fo.flow.PageNumber;
 import org.apache.fop.fo.flow.PageNumberCitation;
 import org.apache.fop.fo.flow.PageNumberCitationLast;
+import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.fop.fo.flow.RetrieveTableMarker;
 import org.apache.fop.fo.flow.Wrapper;
 import org.apache.fop.fo.flow.table.Table;
 import org.apache.fop.fo.flow.table.TableBody;
@@ -70,14 +75,30 @@ public class FO2StructureTreeConverter e
     /** The top of the {@link converters} stack. */
     private FOEventHandler converter;
 
-    private final Stack<FOEventHandler> converters = new Stack<FOEventHandler>();
+    private Stack<FOEventHandler> converters = new Stack<FOEventHandler>();
 
-    private final FOEventHandler structureTreeEventTrigger;
+    private final StructureTreeEventTrigger structureTreeEventTrigger;
 
     /** The descendants of some elements like fo:leader must be ignored. */
     private final FOEventHandler eventSwallower = new FOEventHandler() {
     };
 
+    private final Map<AbstractRetrieveMarker, State> states = new HashMap<AbstractRetrieveMarker, State>();
+
+    private static final class State {
+
+        private final FOEventHandler converter;
+
+        private final Stack<FOEventHandler> converters;
+
+        @SuppressWarnings("unchecked")
+        State(FO2StructureTreeConverter o) {
+            this.converter = o.converter;
+            this.converters = (Stack<FOEventHandler>) o.converters.clone();
+        }
+
+    }
+
     /**
      * Creates a new instance.
      *
@@ -459,6 +480,57 @@ public class FO2StructureTreeConverter e
     }
 
     @Override
+    public void startRetrieveMarker(RetrieveMarker retrieveMarker) {
+        converter.startRetrieveMarker(retrieveMarker);
+        saveState(retrieveMarker);
+        super.startRetrieveMarker(retrieveMarker);
+    }
+
+    private void saveState(AbstractRetrieveMarker retrieveMarker) {
+        states.put(retrieveMarker, new State(this));
+    }
+
+    @Override
+    public void endRetrieveMarker(RetrieveMarker retrieveMarker) {
+        converter.endRetrieveMarker(retrieveMarker);
+        super.endRetrieveMarker(retrieveMarker);
+    }
+
+    @Override
+    public void restoreState(RetrieveMarker retrieveMarker) {
+        restoreRetrieveMarkerState(retrieveMarker);
+        converter.restoreState(retrieveMarker);
+        super.restoreState(retrieveMarker);
+    }
+
+    @SuppressWarnings("unchecked")
+    private void restoreRetrieveMarkerState(AbstractRetrieveMarker retrieveMarker) {
+        State state = states.get(retrieveMarker);
+        this.converter = state.converter;
+        this.converters = (Stack<FOEventHandler>) state.converters.clone();
+    }
+
+    @Override
+    public void startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+        converter.startRetrieveTableMarker(retrieveTableMarker);
+        saveState(retrieveTableMarker);
+        super.startRetrieveTableMarker(retrieveTableMarker);
+    }
+
+    @Override
+    public void endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+        converter.endRetrieveTableMarker(retrieveTableMarker);
+        super.endRetrieveTableMarker(retrieveTableMarker);
+    }
+
+    @Override
+    public void restoreState(RetrieveTableMarker retrieveTableMarker) {
+        restoreRetrieveMarkerState(retrieveTableMarker);
+        converter.restoreState(retrieveTableMarker);
+        super.restoreState(retrieveTableMarker);
+    }
+
+    @Override
     public void character(Character c) {
         converter.character(c);
         super.character(c);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/StructureTreeEventTrigger.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/StructureTreeEventTrigger.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/StructureTreeEventTrigger.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/accessibility/fo/StructureTreeEventTrigger.java Mon Apr  8 11:51:52 2013
@@ -19,7 +19,9 @@
 
 package org.apache.fop.accessibility.fo;
 
+import java.util.HashMap;
 import java.util.Locale;
+import java.util.Map;
 import java.util.Stack;
 
 import javax.xml.XMLConstants;
@@ -34,6 +36,7 @@ import org.apache.fop.fo.FOText;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.fo.extensions.InternalElementMapping;
 import org.apache.fop.fo.flow.AbstractGraphics;
+import org.apache.fop.fo.flow.AbstractRetrieveMarker;
 import org.apache.fop.fo.flow.BasicLink;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.BlockContainer;
@@ -50,6 +53,8 @@ import org.apache.fop.fo.flow.ListItemLa
 import org.apache.fop.fo.flow.PageNumber;
 import org.apache.fop.fo.flow.PageNumberCitation;
 import org.apache.fop.fo.flow.PageNumberCitationLast;
+import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.fop.fo.flow.RetrieveTableMarker;
 import org.apache.fop.fo.flow.Wrapper;
 import org.apache.fop.fo.flow.table.Table;
 import org.apache.fop.fo.flow.table.TableBody;
@@ -76,11 +81,30 @@ class StructureTreeEventTrigger extends 
 
     private LayoutMasterSet layoutMasterSet;
 
-    private final Stack<Table> tables = new Stack<Table>();
+    private Stack<Table> tables = new Stack<Table>();
 
-    private final Stack<Boolean> inTableHeader = new Stack<Boolean>();
+    private Stack<Boolean> inTableHeader = new Stack<Boolean>();
 
-    private final Stack<Locale> locales = new Stack<Locale>();
+    private Stack<Locale> locales = new Stack<Locale>();
+
+    private final Map<AbstractRetrieveMarker, State> states = new HashMap<AbstractRetrieveMarker, State>();
+
+    private static final class State {
+
+        private final Stack<Table> tables;
+
+        private final Stack<Boolean> inTableHeader;
+
+        private final Stack<Locale> locales;
+
+        @SuppressWarnings("unchecked")
+        State(StructureTreeEventTrigger o) {
+            this.tables = (Stack<Table>) o.tables.clone();
+            this.inTableHeader = (Stack<Boolean>) o.inTableHeader.clone();
+            this.locales = (Stack<Locale>) o.locales.clone();
+        }
+
+    }
 
     public StructureTreeEventTrigger(StructureTreeEventHandler structureTreeEventHandler) {
         this.structureTreeEventHandler = structureTreeEventHandler;
@@ -415,6 +439,50 @@ class StructureTreeEventTrigger extends 
     }
 
     @Override
+    public void startRetrieveMarker(RetrieveMarker retrieveMarker) {
+        startElementWithID(retrieveMarker);
+        saveState(retrieveMarker);
+    }
+
+    void saveState(AbstractRetrieveMarker retrieveMarker) {
+        states.put(retrieveMarker, new State(this));
+    }
+
+    @Override
+    public void endRetrieveMarker(RetrieveMarker retrieveMarker) {
+        endElement(retrieveMarker);
+    }
+
+    @Override
+    public void restoreState(RetrieveMarker retrieveMarker) {
+        restoreRetrieveMarkerState(retrieveMarker);
+    }
+
+    @SuppressWarnings("unchecked")
+    private void restoreRetrieveMarkerState(AbstractRetrieveMarker retrieveMarker) {
+        State state = states.get(retrieveMarker);
+        tables = (Stack<Table>) state.tables.clone();
+        inTableHeader = (Stack<Boolean>) state.inTableHeader.clone();
+        locales = (Stack<Locale>) state.locales.clone();
+    }
+
+    @Override
+    public void startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+        startElementWithID(retrieveTableMarker);
+        saveState(retrieveTableMarker);
+    }
+
+    @Override
+    public void endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+        endElement(retrieveTableMarker);
+    }
+
+    @Override
+    public void restoreState(RetrieveTableMarker retrieveTableMarker) {
+        restoreRetrieveMarkerState(retrieveTableMarker);
+    }
+
+    @Override
     public void character(Character c) {
         AttributesImpl attributes = createLangAttribute(c.getCommonHyphenation());
         startElementWithID(c, attributes);
@@ -429,8 +497,8 @@ class StructureTreeEventTrigger extends 
     }
 
 
-    private void startElement(FONode node) {
-        startElement(node, new AttributesImpl());
+    private StructureTreeElement startElement(FONode node) {
+        return startElement(node, new AttributesImpl());
     }
 
     private void startElementWithID(FONode node) {
@@ -443,7 +511,8 @@ class StructureTreeEventTrigger extends 
             addRole((CommonAccessibilityHolder) node, attributes);
         }
         node.setStructureTreeElement(
-                structureTreeEventHandler.startReferencedNode(localName, attributes));
+                structureTreeEventHandler.startReferencedNode(localName, attributes,
+                        node.getParent().getStructureTreeElement()));
     }
 
     private void startElementWithIDAndAltText(AbstractGraphics node) {
@@ -453,7 +522,8 @@ class StructureTreeEventTrigger extends 
         addAttribute(attributes, ExtensionElementMapping.URI, "alt-text",
                 ExtensionElementMapping.STANDARD_PREFIX, node.getAltText());
         node.setStructureTreeElement(
-                structureTreeEventHandler.startImageNode(localName, attributes));
+                structureTreeEventHandler.startImageNode(localName, attributes,
+                        node.getParent().getStructureTreeElement()));
     }
 
     private StructureTreeElement startElement(FONode node, AttributesImpl attributes) {
@@ -461,7 +531,8 @@ class StructureTreeEventTrigger extends 
         if (node instanceof CommonAccessibilityHolder) {
             addRole((CommonAccessibilityHolder) node, attributes);
         }
-        return structureTreeEventHandler.startNode(localName, attributes);
+        return structureTreeEventHandler.startNode(localName, attributes,
+                node.getParent().getStructureTreeElement());
     }
 
     private void addNoNamespaceAttribute(AttributesImpl attributes, String name, String value) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/DelegatingFOEventHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/DelegatingFOEventHandler.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/DelegatingFOEventHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/DelegatingFOEventHandler.java Mon Apr  8 11:51:52 2013
@@ -41,6 +41,8 @@ import org.apache.fop.fo.flow.ListItemLa
 import org.apache.fop.fo.flow.PageNumber;
 import org.apache.fop.fo.flow.PageNumberCitation;
 import org.apache.fop.fo.flow.PageNumberCitationLast;
+import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.fop.fo.flow.RetrieveTableMarker;
 import org.apache.fop.fo.flow.Wrapper;
 import org.apache.fop.fo.flow.table.Table;
 import org.apache.fop.fo.flow.table.TableBody;
@@ -383,6 +385,36 @@ public abstract class DelegatingFOEventH
     }
 
     @Override
+    public void startRetrieveMarker(RetrieveMarker retrieveMarker) {
+        delegate.startRetrieveMarker(retrieveMarker);
+    }
+
+    @Override
+    public void endRetrieveMarker(RetrieveMarker retrieveMarker) {
+        delegate.endRetrieveMarker(retrieveMarker);
+    }
+
+    @Override
+    public void restoreState(RetrieveMarker retrieveMarker) {
+        delegate.restoreState(retrieveMarker);
+    }
+
+    @Override
+    public void startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+        delegate.startRetrieveTableMarker(retrieveTableMarker);
+    }
+
+    @Override
+    public void endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+        delegate.endRetrieveTableMarker(retrieveTableMarker);
+    }
+
+    @Override
+    public void restoreState(RetrieveTableMarker retrieveTableMarker) {
+        delegate.restoreState(retrieveTableMarker);
+    }
+
+    @Override
     public void character(Character c) {
         delegate.character(c);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOEventHandler.java Mon Apr  8 11:51:52 2013
@@ -41,6 +41,8 @@ import org.apache.fop.fo.flow.ListItemLa
 import org.apache.fop.fo.flow.PageNumber;
 import org.apache.fop.fo.flow.PageNumberCitation;
 import org.apache.fop.fo.flow.PageNumberCitationLast;
+import org.apache.fop.fo.flow.RetrieveMarker;
+import org.apache.fop.fo.flow.RetrieveTableMarker;
 import org.apache.fop.fo.flow.Wrapper;
 import org.apache.fop.fo.flow.table.Table;
 import org.apache.fop.fo.flow.table.TableBody;
@@ -535,6 +537,56 @@ public abstract class FOEventHandler {
     }
 
     /**
+     * Process the start of a retrieve-marker.
+     *
+     * @param retrieveMarker the retrieve-marker that is starting
+     */
+    public void startRetrieveMarker(RetrieveMarker retrieveMarker) {
+    }
+
+
+    /**
+     * Process the ending of a retrieve-marker.
+     *
+     * @param retrieveMarker the retrieve-marker that is ending
+     */
+    public void endRetrieveMarker(RetrieveMarker retrieveMarker) {
+    }
+
+    /**
+     * Restore the state of this event handler as it was when the given fo:retrieve-marker
+     * element was processed. This method is called at marker retrieval time, so that
+     * events for the marker descendants are fired within the proper context.
+     * <p>The default implementation of this method does nothing.</p>
+     *
+     * @param retrieveMarker the fo:retrieve-marker element that is retrieving markers
+     */
+    public void restoreState(RetrieveMarker retrieveMarker) {
+    }
+
+    /**
+     * Process the start of a retrieve-table-marker.
+     *
+     * @param retrieveTableMarker the retrieve-table-marker that is starting
+     */
+    public void startRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+    }
+
+    /**
+     * Process the ending of a retrieve-table-marker.
+     *
+     * @param retrieveTableMarker the retrieve-table-marker that is ending
+     */
+    public void endRetrieveTableMarker(RetrieveTableMarker retrieveTableMarker) {
+    }
+
+    /**
+     * See {@link #restoreState(RetrieveMarker)}.
+     */
+    public void restoreState(RetrieveTableMarker retrieveTableMarker) {
+    }
+
+    /**
      * Process a Character.
      * @param c Character to process.
      */

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java Mon Apr  8 11:51:52 2013
@@ -311,7 +311,7 @@ public abstract class FONode implements 
      *
      * @throws FOPException if there's a problem during processing
      */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         // do nothing by default
    }
 
@@ -327,7 +327,7 @@ public abstract class FONode implements 
      *
      * @throws FOPException if there's a problem during processing
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         this.finalizeNode();
     }
 
@@ -1093,4 +1093,13 @@ public abstract class FONode implements 
         throw new UnsupportedOperationException();
     }
 
+    /**
+     * Returns the structure tree element associated to this object.
+     *
+     * @return the structure tree element
+     */
+    public StructureTreeElement getStructureTreeElement() {
+        return null;
+    }
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOText.java Mon Apr  8 11:51:52 2013
@@ -193,7 +193,7 @@ public class FOText extends FONode imple
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if ( charBuffer != null ) {
             charBuffer.rewind();
         }
@@ -726,7 +726,7 @@ public class FOText extends FONode imple
         this.structureTreeElement = structureTreeElement;
     }
 
-    /** @return the structure tree element. */
+    @Override
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOTreeBuilder.java Mon Apr  8 11:51:52 2013
@@ -321,7 +321,8 @@ public class FOTreeBuilder extends Defau
             // fo:characters can potentially be removed during
             // white-space handling.
             // Do not notify the FOEventHandler.
-            if (currentFObj.getNameId() != Constants.FO_CHARACTER) {
+            if (currentFObj.getNameId() != Constants.FO_CHARACTER
+                    && (!builderContext.inMarker() || currentFObj.getNameId() == Constants.FO_MARKER)) {
                 currentFObj.startOfNode();
             }
         }
@@ -343,7 +344,8 @@ public class FOTreeBuilder extends Defau
             // fo:characters can potentially be removed during
             // white-space handling.
             // Do not notify the FOEventHandler.
-            if (currentFObj.getNameId() != Constants.FO_CHARACTER) {
+            if (currentFObj.getNameId() != Constants.FO_CHARACTER
+                    && (!builderContext.inMarker() || currentFObj.getNameId() == Constants.FO_MARKER)) {
                 currentFObj.endOfNode();
             }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java Mon Apr  8 11:51:52 2013
@@ -179,7 +179,7 @@ public abstract class FObj extends FONod
      * {@inheritDoc}
      * @throws FOPException FOP Exception
      */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         if (id != null) {
             checkId(id);
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObjMixed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObjMixed.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObjMixed.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObjMixed.java Mon Apr  8 11:51:52 2013
@@ -49,6 +49,16 @@ public abstract class FObjMixed extends 
         super(parent);
     }
 
+    @Override
+    public FONode clone(FONode parent, boolean removeChildren) throws FOPException {
+        flushText();
+        FObjMixed clone = (FObjMixed) super.clone(parent, removeChildren);
+        if (removeChildren) {
+            clone.currentTextNode = null;
+        }
+        return clone;
+    }
+
     /** {@inheritDoc} */
     @Override
     protected void characters(char[] data, int start, int length,
@@ -66,7 +76,7 @@ public abstract class FObjMixed extends 
 
     /** {@inheritDoc} */
     @Override
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
 
         super.endOfNode();
         if (!inMarker() || getNameId() == FO_MARKER) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/ExternalDocument.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/ExternalDocument.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/ExternalDocument.java Mon Apr  8 11:51:52 2013
@@ -86,7 +86,7 @@ public class ExternalDocument extends Ab
      * @throws FOPException in case of processing exception
      * @see org.apache.fop.fo.FONode#startOfNode()
      */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startExternalDocument(this);
     }
@@ -95,7 +95,7 @@ public class ExternalDocument extends Ab
      * @throws FOPException in case of processing exception
      * @see org.apache.fop.fo.FONode#endOfNode()
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         getFOEventHandler().endExternalDocument(this);
         super.endOfNode();
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/destination/Destination.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/destination/Destination.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/destination/Destination.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/extensions/destination/Destination.java Mon Apr  8 11:51:52 2013
@@ -61,7 +61,7 @@ public class Destination extends FONode 
     /**
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         root.addDestination(this);
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractGraphics.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractGraphics.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractGraphics.java Mon Apr  8 11:51:52 2013
@@ -234,7 +234,7 @@ public abstract class AbstractGraphics e
         this.structureTreeElement = structureTreeElement;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java Mon Apr  8 11:51:52 2013
@@ -83,7 +83,7 @@ public abstract class AbstractListItemPa
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!this.blockItemFound) {
             String contentModel = "marker* (%block;)+";
             getFOValidationEventProducer().missingChildElement(this, getName(),

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java Mon Apr  8 11:51:52 2013
@@ -160,7 +160,7 @@ public abstract class AbstractPageNumber
         this.structureTreeElement = structureTreeElement;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java Mon Apr  8 11:51:52 2013
@@ -23,6 +23,7 @@ import java.util.Iterator;
 
 import org.xml.sax.Locator;
 
+import org.apache.fop.accessibility.StructureTreeElement;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOText;
@@ -51,6 +52,8 @@ public abstract class AbstractRetrieveMa
     private int boundary;
     private String boundaryLabel;
 
+    private StructureTreeElement structureTreeElement;
+
     /**
      * Create a new AbstractRetrieveMarker instance that
      * is a child of the given {@link FONode}
@@ -86,6 +89,16 @@ public abstract class AbstractRetrieveMa
         this.propertyList = pList.getParentPropertyList();
     }
 
+    @Override
+    public void setStructureTreeElement(StructureTreeElement structureTreeElement) {
+        this.structureTreeElement = structureTreeElement;
+    }
+
+    @Override
+    public StructureTreeElement getStructureTreeElement() {
+        return structureTreeElement;
+    }
+
     private PropertyList createPropertyListFor(FObj fo, PropertyList parent) {
         return getBuilderContext().getPropertyListMaker().make(fo, parent);
     }
@@ -108,6 +121,7 @@ public abstract class AbstractRetrieveMa
                         pList,
                         newPropertyList);
                 addChildTo(newChild, newParent);
+                newChild.startOfNode();
                 switch ( newChild.getNameId() ) {
                 case FO_TABLE:
                     Table t = (Table) child;
@@ -132,17 +146,22 @@ public abstract class AbstractRetrieveMa
                                     newChild, marker, newPropertyList);
                     break;
                 }
+                newChild.endOfNode();
             } else if (child instanceof FOText) {
                 FOText ft = (FOText) newChild;
                 ft.bind(parentPropertyList);
                 addChildTo(newChild, newParent);
+                if (newParent instanceof AbstractRetrieveMarker) {
+                    /*
+                     * Otherwise the parent of newChild is a cloned FObjMixed that will
+                     * call this FOText's endOfNode when its own endOfNode method is
+                     * called.
+                     */
+                    newChild.endOfNode();
+                }
             } else if (child instanceof XMLObj) {
                 addChildTo(newChild, newParent);
             }
-
-            // trigger end-of-node white-space handling
-            // and finalization for table-FOs
-            newChild.finalizeNode();
         }
     }
 
@@ -191,6 +210,7 @@ public abstract class AbstractRetrieveMa
         }
         if (marker.getChildNodes() != null) {
             try {
+                restoreFOEventHandlerState();
                 cloneFromMarker(marker);
             } catch (FOPException exc) {
                 getFOValidationEventProducer().markerCloningFailed(this,
@@ -201,6 +221,8 @@ public abstract class AbstractRetrieveMa
         }
     }
 
+    protected abstract void restoreFOEventHandlerState();
+
     /**
      * Return the value for the <code>retrieve-class-name</code>
      * property

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BasicLink.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BasicLink.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BasicLink.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BasicLink.java Mon Apr  8 11:51:52 2013
@@ -96,13 +96,13 @@ public class BasicLink extends InlineLev
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startLink(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endLink(this);
     }
@@ -148,7 +148,7 @@ public class BasicLink extends InlineLev
         this.structureTreeElement = structureTreeElement;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Block.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Block.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Block.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Block.java Mon Apr  8 11:51:52 2013
@@ -140,13 +140,13 @@ public class Block extends FObjMixed imp
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startBlock(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endBlock(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/BlockContainer.java Mon Apr  8 11:51:52 2013
@@ -103,7 +103,7 @@ public class BlockContainer extends FObj
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startBlockContainer(this);
     }
@@ -138,7 +138,7 @@ public class BlockContainer extends FObj
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!blockItemFound) {
             missingChildElementError("marker* (%block;)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Character.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Character.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Character.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Character.java Mon Apr  8 11:51:52 2013
@@ -116,7 +116,7 @@ public class Character extends FObj impl
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().character(this);
     }
@@ -217,7 +217,7 @@ public class Character extends FObj impl
         this.structureTreeElement = structureTreeElement;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ExternalGraphic.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ExternalGraphic.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ExternalGraphic.java Mon Apr  8 11:51:52 2013
@@ -104,7 +104,7 @@ public class ExternalGraphic extends Abs
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().image(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Float.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Float.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Float.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Float.java Mon Apr  8 11:51:52 2013
@@ -74,7 +74,7 @@ public class Float extends FObj {
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("(%block;)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Footnote.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Footnote.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Footnote.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Footnote.java Mon Apr  8 11:51:52 2013
@@ -56,7 +56,7 @@ public class Footnote extends FObj imple
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         getFOEventHandler().startFootnote(this);
     }
 
@@ -66,7 +66,7 @@ public class Footnote extends FObj imple
      *
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         if (footnoteCitation == null || footnoteBody == null) {
             missingChildElementError("(inline,footnote-body)");

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FootnoteBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FootnoteBody.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FootnoteBody.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/FootnoteBody.java Mon Apr  8 11:51:52 2013
@@ -54,7 +54,7 @@ public class FootnoteBody extends FObj i
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         getFOEventHandler().startFootnoteBody(this);
     }
 
@@ -64,7 +64,7 @@ public class FootnoteBody extends FObj i
      * end of the footnote-body.
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("(%block;)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Inline.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Inline.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Inline.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Inline.java Mon Apr  8 11:51:52 2013
@@ -69,7 +69,7 @@ public class Inline extends InlineLevel 
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
        super.startOfNode();
 
        /* Check to see if this node can have block-level children.
@@ -94,7 +94,7 @@ public class Inline extends InlineLevel 
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endInline(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InlineContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InlineContainer.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InlineContainer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InlineContainer.java Mon Apr  8 11:51:52 2013
@@ -119,7 +119,7 @@ public class InlineContainer extends FOb
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!blockItemFound) {
             missingChildElementError("marker* (%block;)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java Mon Apr  8 11:51:52 2013
@@ -60,7 +60,7 @@ public class InstreamForeignObject exten
     }
 
     @Override
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startInstreamForeignObject(this);
     }
@@ -71,7 +71,7 @@ public class InstreamForeignObject exten
      * the end of the instream-foreign-object.
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("one (1) non-XSL namespace child");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Leader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Leader.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Leader.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Leader.java Mon Apr  8 11:51:52 2013
@@ -191,13 +191,13 @@ public class Leader extends InlineLevel 
     }
 
     @Override
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startLeader(this);
     }
 
     @Override
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endLeader(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListBlock.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListBlock.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListBlock.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListBlock.java Mon Apr  8 11:51:52 2013
@@ -89,7 +89,7 @@ public class ListBlock extends FObj impl
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startList(this);
     }
@@ -100,7 +100,7 @@ public class ListBlock extends FObj impl
      * of the list-block.
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!hasListItem) {
             missingChildElementError("marker* (list-item)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItem.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItem.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItem.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItem.java Mon Apr  8 11:51:52 2013
@@ -83,13 +83,13 @@ public class ListItem extends FObj imple
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startListItem(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (label == null || body == null) {
             missingChildElementError("marker* (list-item-label,list-item-body)");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemBody.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemBody.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemBody.java Mon Apr  8 11:51:52 2013
@@ -36,13 +36,13 @@ public class ListItemBody extends Abstra
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startListBody(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endListBody(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemLabel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemLabel.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemLabel.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ListItemLabel.java Mon Apr  8 11:51:52 2013
@@ -38,13 +38,13 @@ public class ListItemLabel extends Abstr
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startListLabel(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endListLabel(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Marker.java Mon Apr  8 11:51:52 2013
@@ -83,7 +83,7 @@ public class Marker extends FObjMixed {
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() {
+    public void startOfNode() {
         FOTreeBuilderContext builderContext = getBuilderContext();
         // Push a new property list maker which will make MarkerPropertyLists.
         savePropertyListMaker = builderContext.getPropertyListMaker();
@@ -97,7 +97,7 @@ public class Marker extends FObjMixed {
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         // Pop the MarkerPropertyList maker.
         getBuilderContext().setPropertyListMaker(savePropertyListMaker);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiProperties.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiProperties.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiProperties.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiProperties.java Mon Apr  8 11:51:52 2013
@@ -59,7 +59,7 @@ public class MultiProperties extends FOb
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!hasMultiPropertySet || !hasWrapper) {
             missingChildElementError("(multi-property-set+, wrapper)");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiSwitch.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiSwitch.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiSwitch.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/MultiSwitch.java Mon Apr  8 11:51:52 2013
@@ -64,7 +64,7 @@ public class MultiSwitch extends FObj {
 
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("(multi-case+)");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumber.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumber.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumber.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumber.java Mon Apr  8 11:51:52 2013
@@ -106,13 +106,13 @@ public class PageNumber extends FObj
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startPageNumber(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         getFOEventHandler().endPageNumber(this);
     }
 
@@ -182,7 +182,7 @@ public class PageNumber extends FObj
         this.structureTreeElement = structureTreeElement;
     }
 
-    /** {@inheritDoc} */
+    @Override
     public StructureTreeElement getStructureTreeElement() {
         return structureTreeElement;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitation.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitation.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitation.java Mon Apr  8 11:51:52 2013
@@ -41,13 +41,13 @@ public class PageNumberCitation extends 
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startPageNumberCitation(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endPageNumberCitation(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java Mon Apr  8 11:51:52 2013
@@ -42,13 +42,13 @@ public class PageNumberCitationLast exte
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startPageNumberCitationLast(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endPageNumberCitationLast(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Mon Apr  8 11:51:52 2013
@@ -71,6 +71,18 @@ public class RetrieveMarker extends Abst
         setBoundaryLabel((String) pList.get(PR_RETRIEVE_BOUNDARY).getObject());
     }
 
+    @Override
+    public void startOfNode() throws FOPException {
+        super.startOfNode();
+        getFOEventHandler().startRetrieveMarker(this);
+    }
+
+    @Override
+    public void endOfNode() throws FOPException {
+        super.endOfNode();
+        getFOEventHandler().endRetrieveMarker(this);
+    }
+
     /**
      * Return the value for the <code>retrieve-position</code>
      * property
@@ -108,4 +120,10 @@ public class RetrieveMarker extends Abst
     public int getNameId() {
         return FO_RETRIEVE_MARKER;
     }
+
+    @Override
+    protected void restoreFOEventHandlerState() {
+        getFOEventHandler().restoreState(this);
+    }
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java Mon Apr  8 11:51:52 2013
@@ -68,6 +68,18 @@ public class RetrieveTableMarker extends
         setBoundaryLabel((String) pList.get(PR_RETRIEVE_BOUNDARY_WITHIN_TABLE).getObject());
     }
 
+    @Override
+    public void startOfNode() throws FOPException {
+        super.startOfNode();
+        getFOEventHandler().startRetrieveTableMarker(this);
+    }
+
+    @Override
+    public void endOfNode() throws FOPException {
+        super.endOfNode();
+        getFOEventHandler().endRetrieveTableMarker(this);
+    }
+
     /**
      * Return the value for the <code>retrieve-position-within-table</code>
      * property
@@ -113,4 +125,9 @@ public class RetrieveTableMarker extends
         this.lastFOTextProcessed = null;
     }
 
+    @Override
+    protected void restoreFOEventHandlerState() {
+        getFOEventHandler().restoreState(this);
+    }
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Wrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Wrapper.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Wrapper.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Wrapper.java Mon Apr  8 11:51:52 2013
@@ -61,13 +61,13 @@ public class Wrapper extends FObjMixed i
     }
 
     @Override
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startWrapper(this);
     }
 
     @Override
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endWrapper(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/Table.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/Table.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/Table.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/Table.java Mon Apr  8 11:51:52 2013
@@ -179,7 +179,7 @@ public class Table extends TableFObj imp
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startTable(this);
     }
@@ -238,7 +238,7 @@ public class Table extends TableFObj imp
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endTable(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java Mon Apr  8 11:51:52 2013
@@ -87,7 +87,7 @@ public class TableAndCaption extends FOb
      * FOEventHandler that we are at the end of the flow.
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!tableFound) {
             missingChildElementError("marker* table-caption? table");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableBody.java Mon Apr  8 11:51:52 2013
@@ -38,13 +38,13 @@ public class TableBody extends TablePart
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startBody(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endBody(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCaption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCaption.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCaption.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCaption.java Mon Apr  8 11:51:52 2013
@@ -78,7 +78,7 @@ public class TableCaption extends FObj i
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("marker* (%block;)");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCell.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCell.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableCell.java Mon Apr  8 11:51:52 2013
@@ -96,7 +96,7 @@ public class TableCell extends TableFObj
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startCell(this);
     }
@@ -106,7 +106,7 @@ public class TableCell extends TableFObj
      * FOEventHandler that we are at the end of the table-cell.
      * {@inheritDoc}
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endCell(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableFooter.java Mon Apr  8 11:51:52 2013
@@ -41,13 +41,13 @@ public class TableFooter extends TablePa
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startFooter(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endFooter(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableHeader.java Mon Apr  8 11:51:52 2013
@@ -40,13 +40,13 @@ public class TableHeader extends TablePa
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startHeader(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endHeader(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableRow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableRow.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableRow.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TableRow.java Mon Apr  8 11:51:52 2013
@@ -98,13 +98,13 @@ public class TableRow extends TableCellC
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         getFOEventHandler().startRow(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         super.endOfNode();
         getFOEventHandler().endRow(this);
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java Mon Apr  8 11:51:52 2013
@@ -82,7 +82,7 @@ public abstract class AbstractPageSequen
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         this.pageNumberGenerator = new PageNumberGenerator(
                 format, groupingSeparator, groupingSize, letterValue,
                 numberConversionFeatures, language, country);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java Mon Apr  8 11:51:52 2013
@@ -72,7 +72,7 @@ public class ConditionalPageMasterRefere
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         getConcreteParent().addConditionalPageMasterReference(this);
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Declarations.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Declarations.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Declarations.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Declarations.java Mon Apr  8 11:51:52 2013
@@ -75,7 +75,7 @@ public class Declarations extends FObj {
      * a hashmap of color profiles and a list of extension attachments.
      * @throws FOPException if there's a problem during processing
      */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild != null) {
             for (FONodeIterator iter = getChildNodes(); iter.hasNext();) {
                 FONode node = iter.nextNode();

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Flow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Flow.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Flow.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Flow.java Mon Apr  8 11:51:52 2013
@@ -62,7 +62,7 @@ public class Flow extends FObj implement
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         if (flowName == null || flowName.equals("")) {
             missingPropertyError(FLOW_NAME);
         }
@@ -88,7 +88,7 @@ public class Flow extends FObj implement
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!blockItemFound) {
             missingChildElementError("marker* (%block;)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java Mon Apr  8 11:51:52 2013
@@ -62,14 +62,14 @@ public class LayoutMasterSet extends FOb
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         getRoot().setLayoutMasterSet(this);
         simplePageMasters = new java.util.HashMap<String, SimplePageMaster>();
         pageSequenceMasters = new java.util.HashMap<String, PageSequenceMaster>();
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("(simple-page-master|page-sequence-master)+");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java Mon Apr  8 11:51:52 2013
@@ -103,7 +103,7 @@ public class PageSequence extends Abstra
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         super.startOfNode();
         flowMap = new java.util.HashMap<String, FONode>();
 
@@ -121,7 +121,7 @@ public class PageSequence extends Abstra
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (mainFlow == null) {
            missingChildElementError("(title?,static-content*,flow)");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Mon Apr  8 11:51:52 2013
@@ -79,14 +79,14 @@ public class PageSequenceMaster extends 
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         subSequenceSpecifiers = new java.util.ArrayList<SubSequenceSpecifier>();
         layoutMasterSet = parent.getRoot().getLayoutMasterSet();
         layoutMasterSet.addPageSequenceMaster(masterName, this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
             missingChildElementError("(single-page-master-reference|"
                     + "repeatable-page-master-reference|repeatable-page-master-alternatives)+");

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java Mon Apr  8 11:51:52 2013
@@ -68,7 +68,7 @@ public class RepeatablePageMasterAlterna
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         conditionalPageMasterRefs = new java.util.ArrayList<ConditionalPageMasterReference>();
 
         assert parent.getName().equals("fo:page-sequence-master"); //Validation by the parent
@@ -77,7 +77,7 @@ public class RepeatablePageMasterAlterna
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (firstChild == null) {
            missingChildElementError("(conditional-page-master-reference+)");
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java Mon Apr  8 11:51:52 2013
@@ -70,7 +70,7 @@ public class RepeatablePageMasterReferen
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
 
         if (masterReference == null) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Root.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Root.java?rev=1465599&r1=1465598&r2=1465599&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Root.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Root.java Mon Apr  8 11:51:52 2013
@@ -97,12 +97,12 @@ public class Root extends FObj implement
     }
 
      /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
+    public void startOfNode() throws FOPException {
         foEventHandler.startRoot(this);
     }
 
     /** {@inheritDoc} */
-    protected void endOfNode() throws FOPException {
+    public void endOfNode() throws FOPException {
         if (!pageSequenceFound || layoutMasterSet == null) {
             missingChildElementError("(layout-master-set, declarations?, "
                 + "bookmark-tree?, (page-sequence|fox:external-document)+)");



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