1 changed files with 23 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||
#!/bin/bash |
|||
|
|||
# Make full canticle files from comedy-xml.d |
|||
|
|||
xml_dir=../comedy-xml.d |
|||
|
|||
canticles=( 'inferno' 'purgatorio' 'paradiso' ) |
|||
|
|||
for canticle in "${canticles[@]}"; |
|||
do |
|||
canticle_dir="$xml_dir/$canticle-xml.d/" |
|||
canticle_complete=$xml_dir"/$canticle-complete.xml" |
|||
cp ./canticle-base.xml $canticle_complete |
|||
sed -i "s/CANTICLE/The\ Complete\ ${canticle^}/" $canticle_complete |
|||
for canto in $canticle_dir*; |
|||
do |
|||
canto_text="$(xmlstarlet sel -t -c "_:TEI/_:text/_:canto" $canto)" |
|||
echo "$canto_text" >> $canticle_complete |
|||
done |
|||
echo -e "\t</text>" >> $canticle_complete |
|||
echo "</TEI>" >> $canticle_complete |
|||
sed -i 's/<canto\ xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\"/\t\t<canto/g' $canticle_complete |
|||
done |
|||
Loading…
Reference in new issue