Skip to content

Commit c00c0e0

Browse files
committed
XFA subform with occur min=0 and no bound data displaying
Subfrom nomin displays even though it's subform is set to <occur max=-1 min=0. If we look through specs of XFA 3.3 : https://www.pdfa.org/norm-refs/XFA-3_3.pdf - The min attribute is used when processing a form that contains data. Regardless of the data at least this number of instances is included. It is permissible to set this value to zero, in which case the container is entirely excluded if there is no data for it. However, in our case it doesn't happen. On template.js we set our new Occur(min=0 max=-1); Then, when we pass it to bind.js on _bindElement our occur has to go to uselessNode.arr to be removed before compilation. However, we loose it in searchNode on empty merge step. We don't have a match, and in if(this.emptyMerge) line we letting our empty nomin get though by not adding it to uselessNode so it never get removed. By checking the name === nomin and occur.min === 0 we selected interested element and push it to uselessNode so at the end it get removed and we have successfully blanc page.
1 parent 6a15973 commit c00c0e0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/xfa/bind.js

+3
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ class Binder {
643643
: dataNode[$namespaceId];
644644
match = child[$data] = new XmlObject(nsId, child.name);
645645
if (this.emptyMerge) {
646+
if (child.name === "nomin" && child.occur.min === 0) {
647+
uselessNodes.push(child);
648+
}
646649
match[$consumed] = true;
647650
}
648651
dataNode[$appendChild](match);

0 commit comments

Comments
 (0)