Commit Graph
5 Commits
Author SHA1 Message Date
John MacFarlane f37b12d941 Use jq instead of json_reformat in validate-docx-golden-tests2. 2025-05-11 11:01:44 -07:00
Edwin Török b8c921fe7d fix(ci): explicitly choose a .Net version
Upstream OOXML-Validator has added support for building with .Net 8.0 in
commit 29af1086b5c78b6a213e70d2e1cb8da2a8e5b876.
But that means OOXML-Validator can now be built for both .Net 6.0 and 8.0,
so we need to pick which one we want when running, otherwise we get an
error:
```
Unable to run your project
Your project targets multiple frameworks.
Specify which framework to run using '--framework'.
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2024-02-05 15:07:23 -08:00
Edwin Török c6892bec24 ci(validate-docx-golden-tests2): fail on errors
The validator just prints errors, but always exited with nonzero.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-19 15:00:23 -08:00
Edwin Török c5780857e5 fix(docx): fix OOXMLValidator error on KeywordTok output
xmllint doesn't warn about this (maybe because the tag is empty?), but
the order doesn't match wml.xsd:
```
    <w:rPr>
      <w:color w:val="007020"/>
      <w:b/>
    </w:rPr>
```

And OOXMLValidatorCLI does warn about it:
```
{
        "Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.",
        "Path": {
            "NamespacesDefinitions": [
                "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
            ],
            "Namespaces": {

            },
            "XPath": "/w:styles[1]/w:style[40]/w:rPr[1]",
            "PartUri": "/word/styles.xml"
        },
        "Id": "Sch_UnexpectedElementContentExpectingComplex",
        "ErrorType": "Schema"
    }
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-18 17:15:03 -08:00
Edwin Török 3e360f5a3e test(Makefile): add validate-docx-golden-test2
Add a validation rule based on OOXML-Validator which uses the
Open-XML-SDK shipped and maintained as part of dotnet.

This catches a few more issues compared to the .xsd.

Unfortunately currently this executable always exits with 0 even when
validation failed. That can be fixed later by invoking it from a script.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-18 17:15:03 -08:00