↧
Answer by RomanPerekhrest for Identify empty xml files?
to identify and write all xml file names which are empty to a text file for reporting purpose find + xmlstarlet solution: find . -type f -name "*.xml" -exec bash -c \ 'v=$(xmlstarlet sel -t -i...
View ArticleAnswer by Gilles Quenot for Identify empty xml files?
Try this using xmllint with a xpath expression : #!/bin/sh for xml in *.xml; do bool=$(xmllint --xpath 'count(//*)=1 and string-length(//*[1])=1' "$xml") if [ $bool = true ]; then echo "$xml" >>...
View ArticleIdentify empty xml files?
I have a requirement to identify and write all xml file names which are empty to a text file for reporting purpose. Empty , here means the xml file has the usual header tag <?xml version="1.0"...
View Article