summaryrefslogtreecommitdiffstats
path: root/test/w3c/convert-tests.sh
blob: 5de81d833f7ddd7ac922ecb836a0b049a2abdf11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
ME=`basename $0`
DIR="$( cd "$( dirname "$0" )" && pwd )"
cd $DIR

TXMLS=`ls txml/*.txml`

# see http://saxon.sourceforge.net/saxon6.5.1/using-xsl.html
# for TXML in $TXMLS
# do
# 	DEST=ecma/`basename $TXML .txml`.scxml
# 	echo "Processing $TXML to $DEST"
# 	java -jar /Users/sradomski/Developer/Applications/SaxonHE9-4-0-7J/saxon9he.jar $TXML confEcma.xsl -o:$DEST
# done
#
# for TXML in $TXMLS
# do
# 	DEST=xpath/`basename $TXML .txml`.scxml
# 	echo "Processing $TXML to $DEST"
# 	java -jar /Users/sradomski/Developer/Applications/SaxonHE9-4-0-7J/saxon9he.jar $TXML confXPath.xsl -o:$DEST
# done

for TXML in $TXMLS
do
	DEST=promela/`basename $TXML .txml`.scxml
	echo "Processing $TXML to $DEST"
	java -jar /Users/sradomski/Developer/Applications/SaxonHE9-4-0-7J/saxon9he.jar $TXML confPromela.xsl -o:$DEST
done

cp txml/*.txt ecma/
cp txml/*.txt xpath/
cp txml/*.txt promela/

find ./ecma -type f -exec grep -Ili 'datamodel="xpath"' {} \; |xargs rm -fv
find ./xpath -type f -exec grep -Ili 'datamodel="ecmascript"' {} \; |xargs rm -fv
find ./promela -type f -exec grep -Ili 'datamodel="xpath"' {} \; |xargs rm -fv
find ./promela -type f -exec grep -Ili 'datamodel="ecmascript"' {} \; |xargs rm -fv
find ./promela -type f -exec grep -Ili 'datamodel="null"' {} \; |xargs rm -fv

# format all SCXML files
SCXMLS=`find . -type f -name '*.scxml'`
for SCXML in $SCXMLS
do
	mv $SCXML $SCXML.unformatted.xml
	xmllint --format $SCXML.unformatted.xml > $SCXML
	rm $SCXML.unformatted.xml
done