Skip to content

test(xlsx): validate the package itself — content types, rels, core props - #556

Merged
productdevbook merged 1 commit into
mainfrom
feat/validate-opc-parts
Aug 13, 2026
Merged

test(xlsx): validate the package itself — content types, rels, core props#556
productdevbook merged 1 commit into
mainfrom
feat/validate-opc-parts

Conversation

@productdevbook

Copy link
Copy Markdown
Owner

The last unchecked parts, and the ones whose failure is worst: a malformed .rels breaks the whole workbook, not one sheet.

All valid, across every relationship file in every document. 133 parts across eleven documents now.

part schema
[Content_Types].xml opc-contentTypes.xsd
every *.rels opc-relationships.xsd
docProps/core.xml opc-coreProperties.xsd

The setup cost, recorded so nobody repeats it

These schemas are in ECMA-376 Part 2 — a third download — and opc-coreProperties.xsd needs an edit before it will load at all.

It imports the Dublin Core schemas over plain HTTP; dublincore.org answers with a 302 that Java does not follow, so the parser reads the string 302 Found as schema content and gives up:

s4s-elt-character: Non-whitespace characters are not allowed in schema
elements other than xs:appinfo and xs:documentation. Saw "302 Found".

The header carries the four commands that fetch them and rewrite the imports as relative paths.

--opc is optional; without it the script behaves exactly as before.

Teeth

Checked on this path specifically, since it is a new schema: renaming <Default> to <Bogus> in the content-types writer turns [Content_Types].xml red, with the schema naming exactly what it expected instead.

Only VML is left unchecked, and the reason stays recorded beside the mapping — vml-main.xsd does not load in javax.xml.validation at all.

pnpm test green — 10,571 tests, 232 files.

🤖 Generated with Claude Code

…rops

The last unchecked parts, and the ones whose failure is worst: a
malformed `.rels` breaks the whole workbook rather than one sheet. All
valid, across every relationship file in every document.

133 parts across eleven documents now.

Their schemas are in ECMA-376 Part 2, which is a third download and — for
`opc-coreProperties.xsd` — needs an edit before it will load at all. It
imports the Dublin Core schemas over plain HTTP, dublincore.org answers
with a 302 that Java does not follow, and the parser reads the string
"302 Found" as schema content and gives up. The header carries the four
commands that fetch them and make the imports relative.

`--opc` is optional; without it the script behaves as before.

Checked for teeth on this path specifically, since it is a new schema:
renaming `<Default>` to `<Bogus>` in the content-types writer turns
`[Content_Types].xml` red with the schema naming exactly what it expected.

Only VML is left unchecked, and the reason stays recorded where the
mapping is: `vml-main.xsd` does not load in `javax.xml.validation` at all.

pnpm test green — 10,571 tests, 232 files.
@productdevbook
productdevbook merged commit 0287047 into main Aug 13, 2026
6 checks passed
@productdevbook
productdevbook deleted the feat/validate-opc-parts branch August 13, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant