f67070
1,/
f67070
f67070
# on each new iso-code process the current one
f67070
\!\(<iso_639_entry\|< iso_639_entries="">\)!{
f67070
    x
f67070
    s/^$//
f67070
    # we are on the first iso-code--nothing to process here
f67070
    t
f67070
    # process and write to output
f67070
    s/\s\+/ /g
f67070
    s/
f67070
    s!/\s*>!!
f67070
    # use '%' as a separator of parsed and unparsed input
f67070
    s/\(.*\)iso_639_2T_code="\([^"]\+\)"\(.*\)/\2 % \1 \3/
f67070
    s/\([^%]\+\)%\(.*\)iso_639_2B_code="\([^"]\+\)"\(.*\)/\1\t\3 % \2 \4/
f67070
    #  clear subst. memory for the next t
f67070
    t clear
f67070
    :clear
f67070
    s/\([^%]\+\)%\(.*\)iso_639_1_code="\([^"]\+\)"\(.*\)/\1\t\3 % \2 \4/
f67070
    t name
f67070
    # no 639-1 code--write xx
f67070
    s/%/\tXX %/
f67070
    :name
f67070
    s/\([^%]\+\)%\(.*\)name="\([^"]\+\)"\(.*\)/\1\t\3/
f67070
    s/ \t/\t/g
f67070
    p
f67070
    b
f67070
    :noout
f67070
}
f67070
f67070
H