Commit 341e3409 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-06-15 21:43:43 by cvscast] - fixed test.sh so that complains about unexistent arguments

- added regtests for xsd:all

- added regtest for global attribute references

- added regtest for recursive types in the interpreter zack

Original author: cvscast
Date: 2003-06-15 21:43:43+00:00
parent 35421e52
schema A = "schema/regtest/all.xsd" ;;
let v = load_xml "schema/regtest/all.xml" ;;
let vv = validate v with A # all ;;
<all>
<elt5/>
<elt1/>
<elt4/>
<elt3/>
</all>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="all" type="rootT"/>
<xsd:complexType name="rootT">
<xsd:all>
<xsd:element name="elt1" type="xsd:string"/>
<xsd:element name="elt2" minOccurs="0" type="xsd:string"/>
<xsd:element name="elt3" minOccurs="0" type="xsd:string"/>
<xsd:element name="elt4" type="xsd:string"/>
<xsd:element name="elt5" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
<foo attrib="10">
<bar>not so interesting</bar>
</foo>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="foo" type="fooT" />
<xsd:attribute name="attrib" type="xsd:integer"/>
<xsd:complexType name="fooT">
<xsd:sequence>
<xsd:element name="bar" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute ref="attrib"/>
</xsd:complexType>
</xsd:schema>
schema R1 = "schema/regtest/recursion.xsd" ;;
let v1 = load_xml "schema/regtest/recursion.xml" ;;
let vv1 = validate v1 with R1 # foo ;;
schema R2 = "schema/regtest/recursion2.xsd" ;;
let v2 = load_xml "schema/regtest/recursion2.xml" ;;
let vv2 = validate v2 with R2 # foo ;;
......@@ -3,11 +3,15 @@
VALIDATE="./validate"
ROOT="schema/regtest"
LOG="$ROOT/regtest.log"
if [ -f "$ROOT/$1" ]; then
if (echo $1 | grep "\.xsd" > /dev/null) then
$VALIDATE $ROOT/$1 $ROOT/`echo "$1" | sed 's/xsd$/xml/'`
elif (echo $1 | grep "\.cd" > /dev/null) then
./cduce $ROOT/$1
if [ ! -z "$1" ]; then
if [ -f "$ROOT/$1" ]; then
if (echo $1 | grep "\.xsd" > /dev/null) then
$VALIDATE $ROOT/$1 $ROOT/`echo "$1" | sed 's/xsd$/xml/'`
elif (echo $1 | grep "\.cd" > /dev/null) then
./cduce $ROOT/$1
else
echo "Don't know what to do with '$1'."
fi
else
echo "Don't know what to do with '$1'."
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment