From: Glen Mazza Date: Mon, 6 Sep 2004 21:23:23 +0000 (+0000) Subject: PR: X-Git-Tag: Root_Temp_KnuthStylePageBreaking~576 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=377dcebcd8de52b7e4b59059fdd6156e53cd4923;p=xmlgraphics-fop.git PR: Obtained from: Submitted by: Reviewed by: validateChildNode() for fo:table-row added. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197915 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java index fffd00e8b..8fd281519 100644 --- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java +++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java @@ -59,8 +59,7 @@ public class MultiSwitch extends FObj { } /** - * 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 { diff --git a/src/java/org/apache/fop/fo/flow/TableRow.java b/src/java/org/apache/fop/fo/flow/TableRow.java index 680cb0b65..ec3057cb2 100644 --- a/src/java/org/apache/fop/fo/flow/TableRow.java +++ b/src/java/org/apache/fop/fo/flow/TableRow.java @@ -23,6 +23,7 @@ import java.util.List; // XML import org.xml.sax.Attributes; +import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP @@ -37,7 +38,6 @@ import org.apache.fop.fo.properties.Property; /** * Class modelling the fo:table-row object. - * @todo implement validateChildNode() */ public class TableRow extends FObj { @@ -67,8 +67,24 @@ public class TableRow extends FObj { 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 @@ public class TableRow extends FObj { return keepWithPrevious; } + /** + * @todo see if should remove, or move code to addProperties() + */ private void doSetup() { this.breakAfter = getPropEnum(PR_BREAK_AFTER); this.backgroundColor =