* made filename appear as CustomDeviceMode/@name
[rgd2midnam.git] / rgd2midnam.sh
blobe6c757d1383cf7cad8247043bb7eecbdf0d5ae4b
1 #!/bin/sh
2 test $# != 1 && echo "Usage: $0 <rgd-file>" && exit 1
4 echo '<?xml version="1.0" encoding="UTF-8"?>'
5 echo '<!DOCTYPE MIDINameDocument PUBLIC "-//MIDI Manufacturers Association//DTD MIDINameDocument 1.0//EN" "http://www.midi.org/dtds/MIDINameDocument10.dtd">'
6 echo
7 gunzip -c $1 | xsltproc --param filename \"$(basename $1 .lscp.rgd)\" rgd2midnam.xsl - | xmllint --format --encode UTF-8 --dtdvalid http://www.midi.org/dtds/MIDINameDocument10.dtd - | sed '1d'