Last active
January 25, 2017 16:23
-
-
Save molotovbliss/4b9f4f89a3fa6c2264f8015cbb7d1569 to your computer and use it in GitHub Desktop.
Batch over current working directory using XMLlint to ensure well formed XML document
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
# Batch over current working directory using XMLlint to ensure well formed XML document. --schema for.xsd | |
find . -name "*.xml" -type f | xargs xmllint --noout | |
# Batch over current working directory using XMLlint and repair malformed XML docs | |
find . -name "*.xml" -type f | xmllint --format --recover --noout --output | |
# Single file check: | |
xmllint --noout <file.xml> | |
# Fix malformed XML in PHP | |
$xml = new DomDocument(); | |
$xml->recover=true; | |
$xml->loadXML('<root><tag>hello world</root>'); | |
echo $xml->saveXML(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment