Skip to content

Instantly share code, notes, and snippets.

@edwintorok
Created December 18, 2023 19:26
Show Gist options
  • Save edwintorok/0938a14eba775e32975e2027af15c29e to your computer and use it in GitHub Desktop.
Save edwintorok/0938a14eba775e32975e2027af15c29e to your computer and use it in GitHub Desktop.
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