System.out.println("name = " + elementName);
}
- /**
- * Returns the name of the node
- * @return the name of this node
- */
- public String getName() {
- return null;
- }
-
- /**
- * Returns the Constants class integer value of this node
- * @return the integer enumeration of this FO (e.g., FO_ROOT)
- * if a formatting object, FO_UNKNOWN_NODE otherwise
- */
- public int getNameId() {
- return Constants.FO_UNKNOWN_NODE;
- }
-
/**
* Checks to make sure, during SAX processing of input document, that the
* incoming node is valid for the this (parent) node (e.g., checking to
return "Error(" + loc.getLineNumber() + "/" + loc.getColumnNumber() + "): ";
}
}
+
+ /**
+ * Returns the name of the node
+ * @return the name of this node
+ */
+ public String getName() {
+ return null;
+ }
+
+ /**
+ * Returns the Constants class integer value of this node
+ * @return the integer enumeration of this FO (e.g., FO_ROOT)
+ * if a formatting object, FO_UNKNOWN_NODE otherwise
+ */
+ public int getNameId() {
+ return Constants.FO_UNKNOWN_NODE;
+ }
}
|| lName.equals("page-number")
|| lName.equals("page-number-citation")
|| lName.equals("basic-link")
- || lName.equals("multi-toggle")
- || (!isOutOfLineFODescendant && lName.equals("footnote"))
+ || (lName.equals("multi-toggle")
+ && (getNameId() == FO_MULTI_CASE || findAncestor(FO_MULTI_CASE) > 0))
+ || (lName.equals("footnote") && !isOutOfLineFODescendant)
|| isNeutralItem(nsURI, lName)));
}
/**
* Convenience method for validity checking. Checks if the
* current node has an ancestor of a given name.
- * @param ancestorName -- node name to check for (e.g., "fo:root")
+ * @param ancestorID -- Constants ID of node name to check for (e.g., FO_ROOT)
* @return number of levels above FO where ancestor exists,
* -1 if not found
*/
- protected int findAncestor(String ancestorName) {
+ protected int findAncestor(int ancestorID) {
int found = 1;
FONode temp = getParent();
while (temp != null) {
- if (temp.getName().equals(ancestorName)) {
+ if (temp.getNameId() == ancestorID) {
return found;
}
found += 1;
/* Check to see if this node can have block-level children.
* See validateChildNode() below.
*/
- int lvlLeader = findAncestor("fo:leader");
- int lvlInCntr = findAncestor("fo:inline-container");
- int lvlInline = findAncestor("fo:inline");
- int lvlFootnote = findAncestor("fo:footnote");
+ int lvlLeader = findAncestor(FO_LEADER);
+ int lvlInCntr = findAncestor(FO_INLINE_CONTAINER);
+ int lvlInline = findAncestor(FO_INLINE);
+ int lvlFootnote = findAncestor(FO_FOOTNOTE);
if (lvlLeader > 0) {
if (lvlInCntr < 0 ||
/* Check to see if this node can have block-level children.
* See validateChildNode() below.
*/
- int lvlLeader = findAncestor("fo:leader");
- int lvlFootnote = findAncestor("fo:footnote");
- int lvlInCntr = findAncestor("fo:inline-container");
+ int lvlLeader = findAncestor(FO_LEADER);
+ int lvlFootnote = findAncestor(FO_FOOTNOTE);
+ int lvlInCntr = findAncestor(FO_INLINE_CONTAINER);
if (lvlLeader > 0) {
if (lvlInCntr < 0 ||