Automating some repetitive tasks through XSLT
Posted by mholmes on 18 Mar 2010 in Activity log
We met this morning to discuss ways to relieve SK of some of her more tedious work during the editing process. We decided that some processes can be automated, and accomplished through XSLT on the files still awaiting editing. These are the details (from which I'll later write the XSLT):
- Where an
<entry>
has multiple<form>
elements:- Keep only the first one.
- Append the contents of each
<pron>
in the subsequent<form>
s to the<pron>
in the first<form>
.
- Where an
<entry>
has multiple<sense>
elements:- Copy the contents of #2ff to the end of #1.
- Delete #2ff.
- Delete any empty
<sense>
elements. - In every
<quote>
:- Start by adding this hard-coded content at the beginning:
<phr type="p" subtype="u"></phr><bibl>ECH</bibl>
- Next, wrap the first text node in a
<phr type="n">
tag. - Append any
<bibl>
which is a following-sibling of the parent<quote>
. gloss[parent::quote]
should be changed to<seg>
.- Then find any asterisk in its content, and wrap a
<gloss>
tag around that word, removing the asterisk. - Next, append any
<bibl>
which is a following-sibling of the parent<quote>
. - Output the rest as-is (should there be anything else?).
- Start by adding this hard-coded content at the beginning:
Finally, there needs to be a change to the server-side code, because "phonemic" and "narrow" as values of @type
will be changed to "p" and "n" respectively, while @subtype
will go from "unattested" to "u".