gmazza 2004/07/03 22:15:38
Modified: src/java/org/apache/fop/fo FONode.java
src/java/org/apache/fop/fo/pagination Flow.java
Log:
validateChildNode() activated for fo:flow.
Revision Changes Path
1.27 +1 -1 xml-fop/src/java/org/apache/fop/fo/FONode.java
Index: FONode.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- FONode.java 4 Jul 2004 04:50:54 -0000 1.26
+++ FONode.java 4 Jul 2004 05:15:38 -0000 1.27
@@ -258,7 +258,7 @@
protected void nodesOutOfOrderError(Locator loc, String tooLateNode,
String tooEarlyNode) {
throw new IllegalArgumentException(
- errorText(loc) + getName() + ", " + tooLateNode
+ errorText(loc) + "For " + getName() + ", " + tooLateNode
+ " must be declared before " + tooEarlyNode + ".");
}
1.16 +17 -7 xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java
Index: Flow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Flow.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Flow.java 27 Jun 2004 13:29:32 -0000 1.15
+++ Flow.java 4 Jul 2004 05:15:38 -0000 1.16
@@ -28,6 +28,7 @@
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
@@ -57,6 +58,11 @@
private int contentWidth;
/**
+ * Content-width of current column area during layout
+ */
+ private boolean blockItemFound = false;
+
+ /**
* @param parent FONode that is the parent of this object
*/
public Flow(FONode parent) {
@@ -65,15 +71,19 @@
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
- * XSL/FOP Content Model: markers* (%block;)+
+ * XSL/FOP Content Model: marker* (%block;)+
*/
-/* temporarily disabled: need to account for fo-markers which may be initial
children
protected void validateChildNode(Locator loc, String nsURI, String localName) {
- if (!isBlockItem(nsURI, localName)) {
+ if (nsURI == FOElementMapping.URI && localName.equals("marker")) {
+ if (blockItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker", "(%block;)");
+ }
+ } else if (!isBlockItem(nsURI, localName)) {
invalidChildError(loc, nsURI, localName);
+ } else {
+ blockItemFound = true;
}
}
-*/
/**
* Make sure content model satisfied, if so then tell the
@@ -81,8 +91,8 @@
* @see org.apache.fop.fo.FONode#end
*/
protected void end() {
- if (children == null) {
- missingChildElementError("(%block;)+");
+ if (!blockItemFound) {
+ missingChildElementError("marker* (%block;)+");
}
getFOInputHandler().endFlow(this);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]