From 450f1eeb3a2bd8caf2238e642097d16906c04e37 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Sun, 29 Aug 2004 13:27:08 +0000 Subject: Three more validateChildNodes() added. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197893 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/flow/MultiSwitch.java | 29 +++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/java/org/apache/fop/fo/flow/MultiSwitch.java') diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java index 9c653172c..bc075ab7f 100644 --- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java +++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java @@ -18,13 +18,18 @@ package org.apache.fop.fo.flow; +// XML +import org.xml.sax.Attributes; +import org.xml.sax.Locator; +import org.xml.sax.SAXParseException; + // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; /** * Class modelling the fo:multi-switch object. - * @todo implement validateChildNode() + * @todo needs implementation */ public class MultiSwitch extends FObj { @@ -42,6 +47,28 @@ public class MultiSwitch extends FObj { } } + /** + * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) + * XSL Content Model: (multi-case+) + */ + protected void validateChildNode(Locator loc, String nsURI, String localName) + throws SAXParseException { + if (!(nsURI == FO_URI && localName.equals("multi-case"))) { + invalidChildError(loc, nsURI, localName); + } + } + + /** + * Make sure content model satisfied, if so then tell the + * FOInputHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#end + */ + protected void endOfNode() throws SAXParseException { + if (childNodes == null) { + missingChildElementError("(multi-case+)"); + } + } + /** * @see org.apache.fop.fo.FObj#getName() */ -- cgit v1.2.3