Debian Codegraph @

ogr/ogrsf_frmts/sosi/tools/convert.sh

raw
1 #!/bin/bash
2
3 # requires xsltproc - if you are not on linux or prefer to use another XSLT processor, follow the human-readable instructions
4
5 cp ../ogrsosidatatypes.h ../ogrsosidatatypes.h.bak 2>/dev/null || true # make a backup of the old header
6
7 xsltproc basicelements.xslt Elementdefinisjoner.xml | tail -n +2 > ../ogrsosidatatypes.h # apply basicelements.xslt, skip XML header
8 head -n -1 Gruppeelement_sammensetning.xml > both.xml # concatenate both input files into a single file,
9 tail -n +3 Elementdefinisjoner.xml >> both.xml # moving all elements into the <dataroot> node
10 xsltproc groupelements.xslt both.xml | tail -n +2 >> ../ogrsosidatatypes.h # apply groupelements.xslt, skip XML header
11 rm both.xml # and attach to ogrsosidatatypes.h