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>
This commit is contained in:
Edwin Török
2023-12-18 23:20:22 +00:00
committed by John MacFarlane
parent 3e360f5a3e
commit c5780857e5
37 changed files with 6 additions and 31 deletions
-25
View File
@@ -1,25 +0,0 @@
#!/bin/sh
# based on validate-docx.sh, and adapted for OOXMLValidatorCLI
# Modified by edwintorok from https://github.com/devoidfury/docx-validator
# to look at more files than just document.xml.
# Further modified by jgm for portability.
tmpdir=$(mktemp -d)
error_files=""
errors=0
VALIDATOR=OOXML-Validator/bin/Release/*/OOXMLValidatorCLI
for file in "$@"; do
file_errors=0
echo "*** Checking $file"
dotnet $(VALIDATOR) "${file}" 2>&1 || file_errors=1
if [ $file_errors -gt 0 ]; then
errors=$((file_errors + errors))
error_files="$error_files\n$file"
fi
done
if [ $errors -gt 0 ]; then
echo "These files failed validation:$error_files"
fi
exit $errors