Using Xinclude

Sometimes files just get too big to be usable. You may than split them up and use <xi:include> to stick them together, including one into the other. In this page we will see how to do this for manuscript files, but the same technique can be used for any other file and the same precautions apply for these to be supported by the application.

If you are using transcription done with transkribus you are likely to have a very large file with a <facsimile> taking thousand of lines which nobody is likely to enjoy scrolling.

In this and other similar cases you can use <xi:include> to move parts of your file into separate files. First, make a collection/folder which has the name of your file. Then move your file inside it. This way we are sure not to have duplicates. You can now make a separate XML file which contains your facsimile element with all its contents and call it for example facsimile.xml and do the same for the text generated from Transkribus. You will have something like this.

  1. ESap028
    1. ESap028.xml
    2. facsimile.xml
    3. transkribusText.xml

Remember to reproduce the TEI namespace, at the top element of the included files.


                        <div type="edition" xml:id="Transkribus" subtype="transkribus">
                            ...
                        </div>
                    

Example 1

Another small step you need to take is to remove @xml:base from <text>

Now that those files exist and contain parts of your initial huge file, you can include them into the, now thin, manuscript file with <xi:include> like in the ESap028 example.

You can include in files which are included, but please do not go deeper with folders than this order, just keep them all in the same folder, so that the relative path in @href can be simply the filename.

IMPORTANT: if you are using the <xi:include> for your transcription and the main manuscript record already contains a <text> element, you must (1) remove the <text> and <body> tags in the transkribusText.xml file, and (2) insert the relevant <xi:include> element inside of the <text> element of your main file, cp. this fix for an example.

Now, there are some qui-pro-quos. For example, validation will only be run from the main file. If you are working on any part you should look at errors report in the main file. Also, Atom does not support this.

This page is referred to in the following pages

    Revisions of this page

    • Pietro Maria Liuzzo on 2021-02-08: first version draft