diff options
Diffstat (limited to 'examples/valid1')
-rw-r--r-- | examples/valid1 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/examples/valid1 b/examples/valid1 new file mode 100644 index 0000000..7fc17d1 --- /dev/null +++ b/examples/valid1 @@ -0,0 +1,45 @@ +#!/bin/sh +# Validate XML documents using well-formedness/DTD/XSD/RelaxNG checks +echo "===============================================" +echo "Well-Formedness Validation Tests" +echo "- 1 -------------------------------------------" +./xmlstarlet val xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 2 -------------------------------------------" +./xmlstarlet val -g xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 3 -------------------------------------------" +./xmlstarlet val -b xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 4 -------------------------------------------" +./xmlstarlet val -q xml/table.xml xml/tab-obj.xml 2>/dev/null; echo $? + +echo "===============================================" +echo "DTD Validation Tests" +echo "- 1 -------------------------------------------" +./xmlstarlet val -d dtd/table.dtd xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 2 -------------------------------------------" +./xmlstarlet val -g -d dtd/table.dtd xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 3 -------------------------------------------" +./xmlstarlet val -b -d dtd/table.dtd xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 4 -------------------------------------------" +./xmlstarlet val -q -d dtd/table.dtd xml/table.xml 2>/dev/null; echo $? + +echo "===============================================" +echo "Schema Validation Tests" +echo "- 1 -------------------------------------------" +./xmlstarlet val -s xsd/table.xsd xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 2 -------------------------------------------" +./xmlstarlet val -g -s xsd/table.xsd xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 3 -------------------------------------------" +./xmlstarlet val -b -s xsd/table.xsd xml/table.xml xml/tab-obj.xml xml/tab-bad.xml 2>/dev/null; echo $? +echo "- 4 -------------------------------------------" +./xmlstarlet val -q -s xsd/table.xsd xml/table.xml 2>/dev/null; echo $? + +echo "===============================================" +echo "RelaxNG Schema Validation Tests" +echo "- 1 -------------------------------------------" +./xmlstarlet val -r relaxng/address.rng relaxng/address.xml relaxng/address-bad.xml 2>/dev/null; echo $? +echo "- 2 -------------------------------------------" +./xmlstarlet val -g -r relaxng/address.rng relaxng/address.xml relaxng/address-bad.xml 2>/dev/null; echo $? +echo "- 3 -------------------------------------------" +./xmlstarlet val -b -r relaxng/address.rng relaxng/address.xml relaxng/address-bad.xml 2>/dev/null; echo $? +echo "- 4 -------------------------------------------" +./xmlstarlet val -q -r relaxng/address.rng relaxng/address.xml 2>/dev/null; echo $? |