From 1a7d44265ea9120b4d539dbbd6fb71f4c38d0535 Mon Sep 17 00:00:00 2001 From: aleksUIX Date: Sat, 8 Aug 2026 23:36:16 -0700 Subject: [PATCH 1/2] Restore required elements and ordering on InLine and Wrapper vastInLine_type and vastWrapper_type use , which drops the cardinality of every child it contains. The elements still declare minOccurs="1", but inside a repeating optional choice that governs a single selection rather than the content model. The result is that an empty and an empty validate, singular elements such as AdSystem repeat, and element order is unconstrained. All three were rejected in 2.0 through 4.2. Change both to xs:sequence with the cardinality these elements have always had. No elements are added or removed. The 4.2 element order is kept because it is what the IAB VAST 4.1 and 4.2 sample files emit. Refs #58 --- vast_4.4.xsd | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/vast_4.4.xsd b/vast_4.4.xsd index d946005..ce09058 100644 --- a/vast_4.4.xsd +++ b/vast_4.4.xsd @@ -98,36 +98,36 @@ - + - - - - - - - - - - + + + + + + + + + - - + + + - + + + + + + + + - - - - - - - - + From dd8d381068afb20c1442b5a17cfd816ad7f7618d Mon Sep 17 00:00:00 2001 From: Aleksander Sekowski Date: Fri, 4 Sep 2026 15:47:58 -0700 Subject: [PATCH 2/2] Add xmllint fixtures for InLine and Wrapper cardinality Empty InLine, empty Wrapper, and repeated AdSystem must fail against this tree and still pass origin/master vast_4.4.xsd, which is the #58 bug. --- TESTING.md | 10 ++++ tests/schema/accept-minimal-inline.xml | 23 ++++++++++ tests/schema/accept-minimal-wrapper.xml | 10 ++++ tests/schema/accept-nonlinear-pause.xml | 25 ++++++++++ tests/schema/reject-empty-inline.xml | 4 ++ tests/schema/reject-empty-wrapper.xml | 4 ++ tests/schema/reject-repeated-adsystem.xml | 10 ++++ tests/schema/run.sh | 56 +++++++++++++++++++++++ 8 files changed, 142 insertions(+) create mode 100644 tests/schema/accept-minimal-inline.xml create mode 100644 tests/schema/accept-minimal-wrapper.xml create mode 100644 tests/schema/accept-nonlinear-pause.xml create mode 100644 tests/schema/reject-empty-inline.xml create mode 100644 tests/schema/reject-empty-wrapper.xml create mode 100644 tests/schema/reject-repeated-adsystem.xml create mode 100755 tests/schema/run.sh diff --git a/TESTING.md b/TESTING.md index 7bc5a02..d9a99b3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -2,6 +2,16 @@ Tested with .Net framework code generator xsd.exe Not verified with JAXB. +== Schema regression (libxml2) + +`tests/schema/run.sh` validates the VAST 4.4 InLine/Wrapper cardinality fix +(InteractiveAdvertisingBureau/vast#58) with xmllint: + + ./tests/schema/run.sh + +Requires `xmllint` from libxml2. Empty ``, empty ``, and +repeated `` must fail against this tree. The same three documents +still validate against `origin/master` `vast_4.4.xsd`, which is the bug. == Using xsd.exe from Visual Studio command line diff --git a/tests/schema/accept-minimal-inline.xml b/tests/schema/accept-minimal-inline.xml new file mode 100644 index 0000000..cba48aa --- /dev/null +++ b/tests/schema/accept-minimal-inline.xml @@ -0,0 +1,23 @@ + + + + + iabtechlab + + a532d16d-4d7f-4440-bd29-2ec05553fc80 + Minimal inline + + + + 00:00:16 + + + + + + + + + + + diff --git a/tests/schema/accept-minimal-wrapper.xml b/tests/schema/accept-minimal-wrapper.xml new file mode 100644 index 0000000..7980cfe --- /dev/null +++ b/tests/schema/accept-minimal-wrapper.xml @@ -0,0 +1,10 @@ + + + + + iabtechlab + + + + + diff --git a/tests/schema/accept-nonlinear-pause.xml b/tests/schema/accept-nonlinear-pause.xml new file mode 100644 index 0000000..85c70e9 --- /dev/null +++ b/tests/schema/accept-nonlinear-pause.xml @@ -0,0 +1,25 @@ + + + + + iabtechlab + + a532d16d-4d7f-4440-bd29-2ec05553fc80 + CTV pause + + + + + 00:00:15 + + + + + + + + + + + + diff --git a/tests/schema/reject-empty-inline.xml b/tests/schema/reject-empty-inline.xml new file mode 100644 index 0000000..0d6985a --- /dev/null +++ b/tests/schema/reject-empty-inline.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/schema/reject-empty-wrapper.xml b/tests/schema/reject-empty-wrapper.xml new file mode 100644 index 0000000..0605a97 --- /dev/null +++ b/tests/schema/reject-empty-wrapper.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tests/schema/reject-repeated-adsystem.xml b/tests/schema/reject-repeated-adsystem.xml new file mode 100644 index 0000000..fe7579f --- /dev/null +++ b/tests/schema/reject-repeated-adsystem.xml @@ -0,0 +1,10 @@ + + + + + A + B + C + + + diff --git a/tests/schema/run.sh b/tests/schema/run.sh new file mode 100755 index 0000000..64beab1 --- /dev/null +++ b/tests/schema/run.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# Regression tests for InteractiveAdvertisingBureau/vast#58. +# Empty InLine/Wrapper and repeated AdSystem must fail against this tree's +# vast_4.4.xsd. They still validate against origin/master, which is the bug. +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +DIR="$(cd "$(dirname "$0")" && pwd)" +XSD="$ROOT/vast_4.4.xsd" +XMLLINT="${XMLLINT:-xmllint}" + +if ! command -v "$XMLLINT" >/dev/null 2>&1; then + echo "xmllint not found. Install libxml2-utils." >&2 + exit 1 +fi + +expect_invalid() { + local file="$1" + if "$XMLLINT" --noout --schema "$XSD" "$file" >/dev/null 2>&1; then + echo "FAIL: expected invalid: $(basename "$file")" >&2 + exit 1 + fi + echo "ok reject $(basename "$file")" +} + +expect_valid() { + local file="$1" + if ! "$XMLLINT" --noout --schema "$XSD" "$file" >/dev/null 2>&1; then + echo "FAIL: expected valid: $(basename "$file")" >&2 + "$XMLLINT" --noout --schema "$XSD" "$file" || true + exit 1 + fi + echo "ok accept $(basename "$file")" +} + +expect_invalid "$DIR/reject-empty-inline.xml" +expect_invalid "$DIR/reject-empty-wrapper.xml" +expect_invalid "$DIR/reject-repeated-adsystem.xml" +expect_valid "$DIR/accept-minimal-inline.xml" +expect_valid "$DIR/accept-minimal-wrapper.xml" +expect_valid "$DIR/accept-nonlinear-pause.xml" + +if git -C "$ROOT" rev-parse --verify origin/master >/dev/null 2>&1; then + master_xsd="$(mktemp)" + trap 'rm -f "$master_xsd"' EXIT + git -C "$ROOT" show origin/master:vast_4.4.xsd > "$master_xsd" + for file in "$DIR"/reject-empty-inline.xml "$DIR"/reject-empty-wrapper.xml "$DIR"/reject-repeated-adsystem.xml; do + if ! "$XMLLINT" --noout --schema "$master_xsd" "$file" >/dev/null 2>&1; then + echo "FAIL: $(basename "$file") should still validate against origin/master vast_4.4.xsd (the #58 bug)." >&2 + exit 1 + fi + echo "ok master still accepts $(basename "$file")" + done +fi + +echo "vast 4.4 InLine/Wrapper cardinality tests passed."