Created
December 18, 2023 19:26
-
-
Save edwintorok/0938a14eba775e32975e2027af15c29e to your computer and use it in GitHub Desktop.
This file contains 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
declare -a FILES | |
FILES=(comments document fontTable footnotes numbering settings styles theme1 webSettings) | |
if [ "$1" != "" ]; then | |
rm ./tmp -rf | |
unzip -o -j "$1" -d "./tmp" | |
for i in ${FILES[@]}; do | |
xmllint --format "./tmp/${i}.xml" > "./tmp/${i}-pretty.xml" | |
done | |
fi | |
XSD="docx-validator/schemas/microsoft/wml-2010.xsd" | |
for i in ./tmp/*-pretty.xml; do | |
xmllint -noout -nonet \ | |
-schema "${XSD}" \ | |
"${i}" 2>&1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment