Problems with the order of child elements of div

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with the order of child elements of div

Jan Langenhorst
Dear TEI community!

I am currently compiling a TEI corpus for the research project I'm employed at and I have some issues regarding child elements of <div>. I have already consulted the documentation for various elements, but to no avail.

Every text has the following structure:

<text>
        <body>
            <div type="recto">
                <div type="p">
                    …
                </div>
            </div>
        </body>
</text>

Within the innermost div-block, we want to use both 'plain' text encoded using only ab/lb and 'actually' annotated text using elements such as <signed> and <salute> like so:

        <div type="p">
                <ab>A message…</ab>
                <lb/><signed>John</signed>
        </div>

This works just fine most cases but a problem occurs whenever a sequence of ab-elements is interrupted by one of our other elements. This format for example produces an error when validating:

        <div type="p">
                <ab>A message…</ab>
                <lb/><signed>John</signed>
                <ab>and</ab>  <!— ERROR —>
                <lb/><ab>Martha</ab>
        </div>

I consistently get an error message telling me that ab is not allowed at the position I marked with a comment above (I am aware that in the example above one could - or should - merge all parts of the signature into a single element but the nature of our actual input data does not allow for this at the moment…).

This error is very confusing to me since the TEI documentation does allow for ab-Elements to be contained in div-elements and the error only occurs whenever we include <signed>, <salute>, and so on between a sequence of ab-Elements. If the div element closes with these tags there does not seem the be a problem. I was not able to find a rule in the TEI documentation that states that any of these elements may not be followed by certain other elements…

Maybe someone knows a solution or can point me in the right direction…

Thanks in advance!

Jan Langenhorst
Technische Universität Dresden, Germany
Reply | Threaded
Open this post in threaded view
|

Re: Problems with the order of child elements of div

James Cummings-5

Hi Jan,


This is happening because <signed> is a member of a class of elements called model.divBottom. It is this content model that allows it to appear directly inside <div>. If you look at the content model described on http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-div.html you'll see these elements are only allowed at the bottom of the division and once you start using them it assumes that you are ending it.  More philosophically I think in this case it is because <signed> is not for an individual signature or name but a closing salutation or signature block. (Seethe second example on http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-signed.html. For me, the best way to solve your problem, assuming your example is truly representative is: 

===

<div type="p">
        <ab>A message…</ab>
        <lb/>
       <signed>
          <persName>John</persName> and 
          <lb/><persName>Martha</persName>
        </signed>
 </div>
===


This has a signature block with multiple names and text inside.



Best wishes,

James 


--

Dr James Cummings, [hidden email]

School of English Literature, Language, and Linguistics, Newcastle University


From: TEI (Text Encoding Initiative) public discussion list <[hidden email]> on behalf of Jan Langenhorst <[hidden email]>
Sent: 19 February 2018 17:23:08
To: [hidden email]
Subject: Problems with the order of child elements of div
 
Dear TEI community!

I am currently compiling a TEI corpus for the research project I'm employed at and I have some issues regarding child elements of <div>. I have already consulted the documentation for various elements, but to no avail.

Every text has the following structure:

<text>
        <body>
            <div type="recto">
                <div type="p">
                    …
                </div>
            </div>
        </body>
</text>

Within the innermost div-block, we want to use both 'plain' text encoded using only ab/lb and 'actually' annotated text using elements such as <signed> and <salute> like so:

        <div type="p">
                <ab>A message…</ab>
                <lb/><signed>John</signed>
        </div>

This works just fine most cases but a problem occurs whenever a sequence of ab-elements is interrupted by one of our other elements. This format for example produces an error when validating:

        <div type="p">
                <ab>A message…</ab>
                <lb/><signed>John</signed>
                <ab>and</ab>  <!— ERROR —>
                <lb/><ab>Martha</ab>
        </div>

I consistently get an error message telling me that ab is not allowed at the position I marked with a comment above (I am aware that in the example above one could - or should - merge all parts of the signature into a single element but the nature of our actual input data does not allow for this at the moment…).

This error is very confusing to me since the TEI documentation does allow for ab-Elements to be contained in div-elements and the error only occurs whenever we include <signed>, <salute>, and so on between a sequence of ab-Elements. If the div element closes with these tags there does not seem the be a problem. I was not able to find a rule in the TEI documentation that states that any of these elements may not be followed by certain other elements…

Maybe someone knows a solution or can point me in the right direction…

Thanks in advance!

Jan Langenhorst
Technische Universität Dresden, Germany
Reply | Threaded
Open this post in threaded view
|

Re: Problems with the order of child elements of div

Daniel Johnson
In reply to this post by Jan Langenhorst
Hi Jan,

I'm not sure the best solution for you, but this link I believe explains the error: <http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-model.divBottomPart.html>.

Best,
Dan


On Mon, Feb 19, 2018 at 12:23 PM, Jan Langenhorst <[hidden email]> wrote:
Dear TEI community!

I am currently compiling a TEI corpus for the research project I'm employed at and I have some issues regarding child elements of <div>. I have already consulted the documentation for various elements, but to no avail.

Every text has the following structure:

<text>
        <body>
            <div type="recto">
                <div type="p">
                    …
                </div>
            </div>
        </body>
</text>

Within the innermost div-block, we want to use both 'plain' text encoded using only ab/lb and 'actually' annotated text using elements such as <signed> and <salute> like so:

        <div type="p">
                <ab>A message…</ab>
                <lb/><signed>John</signed>
        </div>

This works just fine most cases but a problem occurs whenever a sequence of ab-elements is interrupted by one of our other elements. This format for example produces an error when validating:

        <div type="p">
                <ab>A message…</ab>
                <lb/><signed>John</signed>
                <ab>and</ab>  <!— ERROR —>
                <lb/><ab>Martha</ab>
        </div>

I consistently get an error message telling me that ab is not allowed at the position I marked with a comment above (I am aware that in the example above one could - or should - merge all parts of the signature into a single element but the nature of our actual input data does not allow for this at the moment…).

This error is very confusing to me since the TEI documentation does allow for ab-Elements to be contained in div-elements and the error only occurs whenever we include <signed>, <salute>, and so on between a sequence of ab-Elements. If the div element closes with these tags there does not seem the be a problem. I was not able to find a rule in the TEI documentation that states that any of these elements may not be followed by certain other elements…

Maybe someone knows a solution or can point me in the right direction…

Thanks in advance!

Jan Langenhorst
Technische Universität Dresden, Germany



--
Daniel Johnson, Ph.D.
English and Digital Humanities Librarian
Hesburgh Libraries

University of Notre Dame
131 Hesburgh Library
Notre Dame, IN 46556
o: 574-631-3457


Reply | Threaded
Open this post in threaded view
|

Re: Problems with the order of child elements of div

Jan Langenhorst
In reply to this post by Jan Langenhorst
Dear James,

thank you so much for your answer and your suggestions!

Jan

--
Student Assistant
TU Dresden
Faculty of Languages, Literature and Culture
Department of German Studies
Chair of Applied Linguistics