pbwest 2002/11/11 08:37:24
Modified: src/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
FoStaticContent.java
Log:
Initial fo:static-content content handling: (%block)+
Revision Changes Path
No revision
No revision
1.1.2.2 +33 -3 xml-fop/src/org/apache/fop/fo/flow/Attic/FoStaticContent.java
Index: FoStaticContent.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/FoStaticContent.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- FoStaticContent.java 7 Nov 2002 23:19:54 -0000 1.1.2.1
+++ FoStaticContent.java 11 Nov 2002 16:37:24 -0000 1.1.2.2
@@ -14,10 +14,12 @@
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.FoXMLEvent;
+import org.apache.fop.xml.UnexpectedStartElementException;
import org.apache.fop.apps.FOPException;
import org.apache.fop.datastructs.TreeException;
import org.apache.fop.datatypes.PropertyValue;
@@ -66,6 +68,9 @@
}
/**
+ * Construct an fo:static-content node, and build the fo:static-content
+ * subtree.
+ * <p>Content model for fo:static-content: (%block;)+
* @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
@@ -77,9 +82,34 @@
super(foTree, FObjectNames.STATIC_CONTENT, parent, event,
FOPropertySets.STATIC_SET, sparsePropsMap, sparseIndices,
numProps);
+ xmlevents = foTree.getXmlevents();
FoXMLEvent ev;
- String nowProcessing;
+ try {
+ // Get at least one %block;
+ if ((ev = xmlevents.expectBlock()) == null)
+ throw new FOPException
+ ("%block; not found in fo:static-content");
+ // Generate the flow object
+ System.out.println("Generating first block for static-content.");
+ FObjects.fobjects.makeFlowObject
+ (foTree, this, ev, FOPropertySets.STATIC_SET);
+ // Get the rest of the %block;s
+ do {
+ ev = xmlevents.expectBlock();
+ if (ev != null) {
+ // Generate the flow object
+ System.out.println
+ ("Generating subsequent block for static-content.");
+ FObjects.fobjects.makeFlowObject
+ (foTree, this, ev, FOPropertySets.STATIC_SET);
+ }
+ } while (ev != null);
+ } catch(UnexpectedStartElementException e) {
+ throw new FOPException
+ ("Block not found or unexpected non-block in fo:static-content");
+ }
+ System.out.println("Making sparsePropsSet for static-content.");
makeSparsePropsSet();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]