Repository navigation
Conversation
A `.docx` is Office Open XML, and a document that breaks the schema is a document that is not what it claims to be. Word opens it anyway, because Word is lenient where the schema is not, and nothing else in the suite could see it. The validator is Microsoft's own — the one the Open XML SDK Productivity Tool uses — and it is run over the examples: the whole corpus of documents this library writes, built by `examples/build.php`. A gate over a selection is a gate over the selection. The test skips itself where the .NET SDK is not, and says what is missing; the job that installs the SDK runs it where it is, so the gate cannot be skipped there. A second test asks the validator about a document with an error in it, which is what proves that the gate can fail.
Drawing a preview of each document's first page takes longer than everything else the build does, and the gate that reads the documents wants the documents. The previews are still emptied with the rest of `out/`: a preview of a document that is no longer built is a picture of nothing, which is the same thing the directory is emptied for.
The gate is red when it lands: over the twenty-nine documents the build writes, Microsoft's validator reports a thousand and two errors, and with the four fixes upstream in PHPWord's writer it reports a hundred and fifty-one, of which forty-four belong to the three committed templates and eighty-eight to PHPWord itself.
…e suite The runner image ships a .NET SDK, so the test does not skip itself there and the gate would have failed the test matrix over a document that is nobody's business but the gate's — and the analysis job needs the test job to have passed. The gate has a job of its own, with the SDK version the validator is built for, and the other jobs leave the suite out.
|
This was referenced Oct 30, 2026
Collaborator
Author
|
Combined into #49, which carries this and the rest of the campaign in one pull request. Nothing is lost: the commits are in it, and the release notes are folded into the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



A
.docxis Office Open XML, and a document that breaks the schema is a document that is not what it claims to be. Word opens it anyway, because Word is lenient where the schema is not, and nothing else in the suite could see it.The check is Microsoft's own validator — the one the Open XML SDK Productivity Tool uses — vendored into
tools/ooxml-validator, and it runs over the examples: the whole corpus of documents this library writes, built byexamples/build.php. A gate over a selection is a gate over the selection.The gate is red when it lands, and that is the point of landing it first.
.dotxtemplatesSo the fixes that are still missing are upstream:
w:gridColcarries aw:typeattribute the schema does not name (85),w:tblHeadercarriesw:val="1"where the SDK readsonoroffalone (3), and the three committed templates carry their ownw:pgSz,w:settingsand style definitions (44). The gate turns green when those land; it is here first so that they are proved to have landed rather than believed to have.The test skips itself where the .NET SDK is not, and says what is missing. The
ooxmljob intests.ymlinstalls the SDK withactions/setup-dotnetand runs the suite there, so the gate cannot be skipped in CI. The runner image ships a .NET SDK of its own, so the jobs that run the rest of the suite leave theooxmlsuite out rather than measure the gate against whatever the image happens to carry — that is what keeps this one red cross from being three of them, and what keeps the SonarCloud job running while the gate is red.A second test asks the validator about a document with an element in it that no schema names, which is what proves the gate can fail.
examples/build.php --no-previewsis new: drawing a preview of each document's first page takes longer than everything else the build does, and the gate wants the documents.