gmazza 2004/09/06 14:23:23
Modified: src/java/org/apache/fop/fo/flow MultiSwitch.java
TableRow.java
Log:
validateChildNode() for fo:table-row added.
Revision Changes Path
1.17 +1 -2 xml-fop/src/java/org/apache/fop/fo/flow/MultiSwitch.java
Index: MultiSwitch.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/MultiSwitch.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- MultiSwitch.java 6 Sep 2004 18:44:31 -0000 1.16
+++ MultiSwitch.java 6 Sep 2004 21:23:23 -0000 1.17
@@ -59,8 +59,7 @@
}
/**
- * Make sure content model satisfied, if so then tell the
- * FOEventHandler that we are at the end of the flow.
+ * Make sure content model satisfied.
* @see org.apache.fop.fo.FONode#end
*/
protected void endOfNode() throws SAXParseException {
1.33 +20 -1 xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java
Index: TableRow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableRow.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- TableRow.java 6 Sep 2004 18:44:31 -0000 1.32
+++ TableRow.java 6 Sep 2004 21:23:23 -0000 1.33
@@ -23,6 +23,7 @@
// XML
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// FOP
@@ -37,7 +38,6 @@
/**
* Class modelling the fo:table-row object.
- * @todo implement validateChildNode()
*/
public class TableRow extends FObj {
@@ -67,8 +67,24 @@
getFOEventHandler().startRow(this);
}
+ /**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL Content Model: (table-cell+)
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
+ throws SAXParseException {
+ if (!(nsURI == FO_URI && localName.equals("table-cell"))) {
+ invalidChildError(loc, nsURI, localName);
+ }
+ }
+ /**
+ * @see org.apache.fop.fo.FONode#end
+ */
protected void endOfNode() throws SAXParseException {
+ if (childNodes == null) {
+ missingChildElementError("(table-cell+)");
+ }
getFOEventHandler().endRow(this);
}
@@ -79,6 +95,9 @@
return keepWithPrevious;
}
+ /**
+ * @todo see if should remove, or move code to addProperties()
+ */
private void doSetup() {
this.breakAfter = getPropEnum(PR_BREAK_AFTER);
this.backgroundColor =
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]