diff --git a/src/core/xfa/bind.js b/src/core/xfa/bind.js index 2929c2541..2baf03ed2 100644 --- a/src/core/xfa/bind.js +++ b/src/core/xfa/bind.js @@ -635,6 +635,13 @@ class Binder { /* skipConsumed = */ this.emptyMerge ).next().value; if (!match) { + // If there is no match (no data) and `min === 0` then + // the container is entirely excluded. + // https://www.pdfa.org/norm-refs/XFA-3_3.pdf#G12.1428332 + if (min === 0) { + uselessNodes.push(child); + continue; + } // We're in matchTemplate mode so create a node in data to reflect // what we've in template. const nsId = diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index f5828ff53..1462d4466 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -213,6 +213,7 @@ !issue4402_reduced.pdf !issue845r.pdf !issue3405r.pdf +!issue14130.pdf !issue7339_reduced.pdf !issue3438.pdf !issue11403_reduced.pdf diff --git a/test/pdfs/issue14130.pdf b/test/pdfs/issue14130.pdf new file mode 100644 index 000000000..ddfaa5406 Binary files /dev/null and b/test/pdfs/issue14130.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 4b97ddc7e..8ef0f33a6 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -4390,6 +4390,13 @@ "link": false, "type": "eq" }, + { "id": "issue14130", + "file": "pdfs/issue14130.pdf", + "md5": "82e7efb0a10122e793fc64348d93dc4e", + "enableXfa": true, + "rounds": 1, + "type": "eq" + }, { "id": "issue6151", "file": "pdfs/issue6151.pdf", "md5": "926f8c6b25e6f0978759f7947d70e079",