Skip to content

Instantly share code, notes, and snippets.

@edwintorok
Created December 17, 2023 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwintorok/c1dee6fdba1932312e38dcf8020050b5 to your computer and use it in GitHub Desktop.
Save edwintorok/c1dee6fdba1932312e38dcf8020050b5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ "$1" != "" ]; then
unzip -o -j "$1" -d "./tmp"
xmllint --format "./tmp/document.xml" > "./tmp/document-pretty.xml"
xmllint --format "./tmp/styles.xml" > "./tmp/styles-pretty.xml"
xmllint --format "./tmp/settings.xml" > "./tmp/settings-pretty.xml"
fi
xmllint -noout -nonet -debugent \
-schema "schemas/microsoft/wml-2010.xsd" \
"./tmp/document-pretty.xml" 2>&1
xmllint -noout -nonet \
-schema "./schemas/microsoft/wml-2010.xsd" \
"./tmp/styles-pretty.xml" 2>&1
xmllint -noout -nonet \
-schema "./schemas/microsoft/wml-2010.xsd" \
"./tmp/settings-pretty.xml" 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment