diff options
author | Glen Mazza <gmazza@apache.org> | 2005-03-05 04:52:06 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2005-03-05 04:52:06 +0000 |
commit | 22ed7684d345f0504de4547f6735069a07d2eb1d (patch) | |
tree | fa56c88127105b097eee985ffbc4d6569a200951 /src/java/org/apache/fop/fo/flow/InlineContainer.java | |
parent | e7450b91fbd4ba6eba950faab0c27e2c17a58d85 (diff) | |
download | xmlgraphics-fop-22ed7684d345f0504de4547f6735069a07d2eb1d.tar.gz xmlgraphics-fop-22ed7684d345f0504de4547f6735069a07d2eb1d.zip |
Validation added for five more FO's.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/InlineContainer.java')
-rw-r--r-- | src/java/org/apache/fop/fo/flow/InlineContainer.java | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java index 6f7d18f01..985e6c508 100644 --- a/src/java/org/apache/fop/fo/flow/InlineContainer.java +++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java @@ -22,12 +22,15 @@ package org.apache.fop.fo.flow; import java.util.ArrayList; import java.util.List; +import org.xml.sax.Locator; + import org.apache.fop.apps.FOPException; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.ValidationException; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.fo.properties.CommonMarginInline; import org.apache.fop.fo.properties.CommonRelativePosition; @@ -38,7 +41,6 @@ import org.apache.fop.layoutmgr.LayoutManager; /** * Class modelling the fo:inline-container object. - * @todo implement validateChildNode() */ public class InlineContainer extends FObj { // The value of properties relevant for fo:inline-container. @@ -65,6 +67,9 @@ public class InlineContainer extends FObj { private int writingMode; // End of property values + /** used for FO validation */ + private boolean blockItemFound = false; + /** * @param parent FONode that is the parent of this object */ @@ -107,6 +112,32 @@ public class InlineContainer extends FObj { } /** + * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) + * XSL Content Model: marker* (%block;)+ + */ + protected void validateChildNode(Locator loc, String nsURI, String localName) + throws ValidationException { + if (nsURI == FO_URI && localName.equals("marker")) { + if (blockItemFound) { + nodesOutOfOrderError(loc, "fo:marker", "(%block;)"); + } + } else if (!isBlockItem(nsURI, localName)) { + invalidChildError(loc, nsURI, localName); + } else { + blockItemFound = true; + } + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws FOPException { + if (!blockItemFound) { + missingChildElementError("marker* (%block;)+"); + } + } + + /** * Return the "id" property. */ public String getId() { |