if (parent.getName().equals("fo:root")) {
Root root = (Root)parent;
+ if (root.getLayoutMasterSet() != null) {
+ throw new FOPException("Multiple fo:layout-master-sets " +
+ "found; only one allowed per document");
+ }
root.setLayoutMasterSet(this);
} else {
throw new FOPException("fo:layout-master-set must be child of fo:root, not "
this.root = (Root)parent;
// this.root.addPageSequence(this);
} else {
- throw new FOPException("page-sequence must be child of root, not "
+ throw new FOPException("Error: page-sequence must be child of root, not "
+ parent.getName());
}
layoutMasterSet = root.getLayoutMasterSet();
-
+
+ if (layoutMasterSet == null) {
+ throw new FOPException("Error: fo:layout-master-set undefined for this document");
+ }
+
// best time to run some checks on LayoutMasterSet
layoutMasterSet.checkRegionNames();