aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/flow/Wrapper.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-05-13 19:16:54 +0000
committerJeremias Maerki <jeremias@apache.org>2005-05-13 19:16:54 +0000
commite835307c9373bed3a8f41bb43e4faee15fdaf548 (patch)
tree04b42bcff456d9216e96b4cfcb572c59baba76e1 /src/java/org/apache/fop/fo/flow/Wrapper.java
parentda85c0b44d79ca790b51fcc0e2700c30e72e9260 (diff)
downloadxmlgraphics-fop-e835307c9373bed3a8f41bb43e4faee15fdaf548.tar.gz
xmlgraphics-fop-e835307c9373bed3a8f41bb43e4faee15fdaf548.zip
Merge of branch Temp_KnuthStylePageBreaking back into HEAD.
Temp_KnuthStylePageBreaking branch and HEAD have been tagged prior to the merge, so merging uncommitted work from the branch should be easier. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198627 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/Wrapper.java')
-rw-r--r--src/java/org/apache/fop/fo/flow/Wrapper.java35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java
index 1de4327e2..c8bb26f73 100644
--- a/src/java/org/apache/fop/fo/flow/Wrapper.java
+++ b/src/java/org/apache/fop/fo/flow/Wrapper.java
@@ -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.
@@ -19,28 +19,26 @@
package org.apache.fop.fo.flow;
// Java
-import java.util.List;
-import java.util.ListIterator;
-
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObjMixed;
import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
+import org.xml.sax.Locator;
/**
* Implementation for fo:wrapper formatting object.
* The wrapper object serves as
* a property holder for its child node objects.
- *
- * Content: (#PCDATA|%inline;|%block;)*
- * Properties: id
- * @todo implement validateChildNode()
*/
public class Wrapper extends FObjMixed {
// The value of properties relevant for fo:wrapper.
private String id;
// End of property values
+ // used for FO validation
+ private boolean blockOrInlineItemFound = false;
+
/**
* @param parent FONode that is the parent of this object
*/
@@ -63,6 +61,27 @@ public class Wrapper extends FObjMixed {
}
/**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
+ * Additionally (unimplemented): "An fo:wrapper that is a child of an
+ * fo:multi-properties is only permitted to have children that would
+ * be permitted in place of the fo:multi-properties."
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
+ throws ValidationException {
+ if (nsURI == FO_URI && localName.equals("marker")) {
+ if (blockOrInlineItemFound) {
+ nodesOutOfOrderError(loc, "fo:marker",
+ "(#PCDATA|%inline;|%block;)");
+ }
+ } else if (isBlockOrInlineItem(nsURI, localName)) {
+ blockOrInlineItemFound = true;
+ } else {
+ invalidChildError(loc, nsURI, localName);
+ }
+ }
+
+ /**
* Return the "id" property.
*/
public String getId() {