spepping 2005/03/02 13:03:25
Modified: src/java/org/apache/fop/fo/flow TableBody.java
TableFooter.java
Log:
Corrected a validation problem. Made TableFooter use TableBody's validation.
Revision Changes Path
1.40 +9 -9 xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java
Index: TableBody.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- TableBody.java 2 Mar 2005 01:59:40 -0000 1.39
+++ TableBody.java 2 Mar 2005 21:03:25 -0000 1.40
@@ -53,8 +53,8 @@
private PropertyList savedPropertyList;
- private boolean tableRowsFound = false;
- private boolean tableColumnsFound = false;
+ protected boolean tableRowsFound = false;
+ protected boolean tableCellsFound = false;
/**
* @param parent FONode that is the parent of the object
@@ -93,7 +93,7 @@
*/
protected void endOfNode() throws FOPException {
getFOEventHandler().endBody(this);
- if (!(tableRowsFound || tableColumnsFound)) {
+ if (!(tableRowsFound || tableCellsFound)) {
if (getUserAgent().validateStrictly()) {
missingChildElementError("marker* (table-row+|table-cell+)");
} else {
@@ -113,21 +113,21 @@
throws ValidationException {
if (nsURI == FO_URI) {
if (localName.equals("marker")) {
- if (tableRowsFound || tableColumnsFound) {
+ if (tableRowsFound || tableCellsFound) {
nodesOutOfOrderError(loc, "fo:marker",
"(table-row+|table-cell+)");
}
} else if (localName.equals("table-row")) {
tableRowsFound = true;
- if (tableColumnsFound) {
+ if (tableCellsFound) {
invalidChildError(loc, nsURI, localName, "Either
fo:table-rows" +
- " or fo:table-columns may be children of an
fo:table-body" +
+ " or fo:table-cells may be children of an " +
getName() +
" but not both");
}
- } else if (localName.equals("table-column")) {
- tableColumnsFound = true;
+ } else if (localName.equals("table-cell")) {
+ tableCellsFound = true;
if (tableRowsFound) {
invalidChildError(loc, nsURI, localName, "Either
fo:table-rows" +
- " or fo:table-columns may be children of an
fo:table-body" +
+ " or fo:table-cells may be children of an " +
getName() +
" but not both");
}
} else {
1.13 +2 -38 xml-fop/src/java/org/apache/fop/fo/flow/TableFooter.java
Index: TableFooter.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableFooter.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TableFooter.java 2 Mar 2005 01:59:40 -0000 1.12
+++ TableFooter.java 2 Mar 2005 21:03:25 -0000 1.13
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,9 +37,6 @@
super(parent);
}
- private boolean tableRowsFound = false;
- private boolean tableColumnsFound = false;
-
/**
* @see org.apache.fop.fo.FONode#startOfNode
*/
@@ -48,44 +45,11 @@
}
/**
- * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String,
String)
- * XSL Content Model: marker* (table-row+|table-cell+)
- */
- protected void validateChildNode(Locator loc, String nsURI, String
localName)
- throws ValidationException {
- if (nsURI == FO_URI) {
- if (localName.equals("marker")) {
- if (tableRowsFound || tableColumnsFound) {
- nodesOutOfOrderError(loc, "fo:marker",
"(table-row+|table-cell+)");
- }
- } else if (localName.equals("table-row")) {
- tableRowsFound = true;
- if (tableColumnsFound) {
- invalidChildError(loc, nsURI, localName, "Either
fo:table-rows" +
- " or fo:table-columns may be children of an
fo:table-footer" +
- " but not both");
- }
- } else if (localName.equals("table-column")) {
- tableColumnsFound = true;
- if (tableRowsFound) {
- invalidChildError(loc, nsURI, localName, "Either
fo:table-rows" +
- " or fo:table-columns may be children of an
fo:table-footer" +
- " but not both");
- }
- } else {
- invalidChildError(loc, nsURI, localName);
- }
- } else {
- invalidChildError(loc, nsURI, localName);
- }
- }
-
- /**
* @see org.apache.fop.fo.FONode#endOfNode
*/
protected void endOfNode() throws FOPException {
// getFOEventHandler().endFooter(this);
- if (!(tableRowsFound || tableColumnsFound)) {
+ if (!(tableRowsFound || tableCellsFound)) {
missingChildElementError("marker* (table-row+|table-cell+)");
}
// convertCellsToRows();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]