Changes for corpus-construction/add-structure-to-transkribus-tei/add_xmlid_to_divs.ipynb: 3 added lines, 6 removed lines.
Original line number
Diff line number
Diff line
%% Cell type:markdown id: tags:
# Adding semi-automatic @xml:id to structured TEI-XML files
Script constructing identifiers for TEI-XML divs, according to the ConDÉ project schema, all values separated by `-`, all body div numbers formatted with three digits and all front|back div numbers formatted with two digits.
For `//tei:text/tei:front` and `//tei:text/tei:back` divs, the construction is as follows:
* source id,
* type of edition (base/txm/simplified),
* current version (alpha/beta)
* frontMatter or backMatter
* number of current front/div or back/div
* subtype of current front/div if any,
* number of current front/div/div if subject div is inside a div itself
⋅⋅* (max 2 levels of div in front and back).
* number of current front/div/div if subject div is inside a div itself (max 2 levels of div in front and back).
For `//tei:text/tei:body` divs, construction is as follows:
* source id,
* type of edition (base/txm/simplified),
* current version (alpha/beta)
* current part div number,
* current chapter div number
⋅⋅* (if subject div is a chapter or section)
* current section div number
⋅⋅* (if subject div is a section).
* current chapter div number (if subject div is a chapter or section)
* current section div number (if subject div is a section).
All body divs need to be typed (`part`/`chapter`/`section`) for this script to function.