]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Change attrSet to TITLE_SET.
authorPeter Bernard West <pbwest@apache.org>
Mon, 11 Nov 2002 16:35:33 +0000 (16:35 +0000)
committerPeter Bernard West <pbwest@apache.org>
Mon, 11 Nov 2002 16:35:33 +0000 (16:35 +0000)
First implementation of fo:title content handling: (#PCDATA|%inline;)*

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195483 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/flow/FoTitle.java

index 71a4e1f3027cca6866dd2093e5ed1815c12f2dc8..48d961ccd3262f5f85d0dfadd8ae30fd70ab8530 100644 (file)
@@ -14,14 +14,19 @@ import org.apache.fop.fo.PropNames;
 import org.apache.fop.fo.FOPropertySets;
 import org.apache.fop.fo.PropertySets;
 import org.apache.fop.fo.FObjectNames;
+import org.apache.fop.fo.FObjects;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTree;
 import org.apache.fop.fo.expr.PropertyException;
+import org.apache.fop.xml.XMLEvent;
 import org.apache.fop.xml.FoXMLEvent;
+import org.apache.fop.xml.SyncedFoXmlEventsBuffer;
+import org.apache.fop.xml.UnexpectedStartElementException;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.datastructs.TreeException;
 import org.apache.fop.datatypes.PropertyValue;
 import org.apache.fop.datatypes.Ints;
+import org.apache.fop.messaging.MessageHandler;
 
 import java.util.HashMap;
 import java.util.BitSet;
@@ -80,7 +85,12 @@ public class FoTitle extends FONode {
         }
     }
 
+    /** The <tt>SyncedFoXmlEventsBuffer</tt> from which events are drawn. */
+    private SyncedFoXmlEventsBuffer xmlevents;
+
     /**
+     * Construct an fo:title node, and build the fo:title subtree.
+     * <p>Content model for fo:title: (#PCDATA|%inline;)*
      * @param foTree the FO tree being built
      * @param parent the parent FONode of this node
      * @param event the <tt>FoXMLEvent</tt> that triggered the creation of
@@ -90,10 +100,26 @@ public class FoTitle extends FONode {
         throws TreeException, FOPException
     {
         super(foTree, FObjectNames.TITLE, parent, event,
-              FOPropertySets.PAGESEQ_SET, sparsePropsMap, sparseIndices,
+              FOPropertySets.TITLE_SET, sparsePropsMap, sparseIndices,
               numProps);
-        FoXMLEvent ev;
-        String nowProcessing;
+        xmlevents = foTree.getXmlevents();
+        FoXMLEvent ev = null;
+        do {
+            try {
+                ev = xmlevents.expectOutOfLinePcdataOrInline();
+            } catch(UnexpectedStartElementException e) {
+                MessageHandler.logln
+                        ("Ignoring unexpected Start Element: "
+                                                         + ev.getQName());
+                ev = xmlevents.getStartElement();
+                ev = xmlevents.getEndElement(ev);
+            }
+            if (ev != null) {
+                // Generate the flow object
+                FObjects.fobjects.makeFlowObject
+                            (foTree, this, ev, FOPropertySets.TITLE_SET);
+            }
+        } while (ev != null);
 
         makeSparsePropsSet();
     }