xmlcross-referencetei

Cross-reference between two xml tei files


I have a first XML TEI file like that:

<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
  <teiHeader xml:lang="en" />
  <text>
    <body>
      <div type="chapter" n="1">
        <p>
          <s xml:id="e_1">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</s>
        </p>
        <p>
          <s xml:id="e_2">"Whenever you feel like criticizing any one," he told me, "just remember that all the people in this world haven't had the advantages that you've had."</s>
        </p>
      </div>
      <div type="chapter" n="2">
        <p>
          <s xml:id="e_3">In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</s>
        </p>
        <p>
          <s xml:id="e_4">"Whenever you feel like criticizing any one," he told me, "just remember that all the people in this world haven't had the advantages that you've had."</s>
        </p>
      </div>
    </body>
  </text>
</TEI>

Then, I have a second XML TEI file like that:

 <?xml version="1.0" encoding="UTF-8"?>
    <TEI xmlns="http://www.tei-c.org/ns/1.0">
      <teiHeader xml:lang="en" />
      <text>
        <body>
          <div type="chapter" n="1">
            <p>
              <s xml:id="f_1">explanation of the sentence e_1.</s>
            </p>
            <p>
              <s xml:id="f_2">explanation of the sentence e_2</s>
            </p>
           </div>
           <div type="chapter" n="2">
            <p>
              <s xml:id="f_3">explanation of the sentence e_1.</s>
            </p>
            <p>
              <s xml:id="f_4">explanation of the sentence e_2</s>
            </p>
           </div>
        </body>
      </text>
    </TEI>

The second file contains few explanations of the first file. I want to know if it is possible to make cross-reference between these two files ? what is the common/best way to do that in XML ? And is there anything specific with the TEI ?


Solution

  • The second file contains few explanations of the first file. I want to know if it is possible to make cross-reference between these two files ? what is the common/best way to do that in XML ? And is there anything specific with the TEI ?

    Yup there is a specific way to do it in TEI – just use the tei:link-element. See: https://tei-c.org/release/doc/tei-p5-doc/en/html/ref-link.html

    In my own project I am using a separate file, which serves like a kind of index and links multiple documents. During processing (e.g. via XSLT or XQuery) the links are used for the desired behavior (e.g. HTML anchor tags).