-1

TEI xml スプレッドシートを受け取ったので、そのレイアウトを作成する必要があります。現在の私の最大の問題は、フォーマットが p タグを使用してテキストを分割していることです。ただし、xml を html に解析すると、タグは存在せず、ドキュメント内にスペースが存在します。

以下は、出力しようとしているモデルです。はい、現在非常に不足しています。

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:tei="http://www.tei-c.org/ns/1.0" exclude-result-prefixes="tei">

<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="/">
     <html xmlns="http://www.w3.org/1999/xhtml">
       <body style="font-family:Arial;font-size:12pt;">
<div style="color:teal;padding:4px; background-color: rgba(255, 255, 255, .8);">
  <span style="font-weight:bold">
    <xsl:value-of select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title"/>
    <p>
      <xsl:value-of select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:author"/>
    </p>
    <xsl:value-of select="tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt"/>

    <p>
      <xsl:value-of select="tei:TEI/tei:text"/>
    </p>
  </span>

</div>
</body>
</html>
  </xsl:template>
  </xsl:stylesheet>

ここに私が解釈しようとしているxmlがあります

    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-model href="http://www.tei-.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
    <?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
    <TEI xmlns="http://www.tei-c.org/ns/1.0">
    <teiHeader>
    <fileDesc>
  <titleStmt>
    <title>No. 1301, Genesis 3:9</title>
    <author>Jacob Cushing</author>
  </titleStmt>
  <publicationStmt>
    <p>
      <address>
        <addrLine>Waltham, Massachusetts</addrLine>
      </address>
    </p>
    <p>
      <date>1770-09-14</date>, <date>1770-09-16</date>
    </p>
  </publicationStmt>
  <sourceDesc>
    <p>
      <bibl>
        <ref target="http://oasis.lib.harvard.edu/oasis/deliver/~div00488">bms 488, Andover-Harvard Theological Library, Harvard Divinity School</ref>
      </bibl>
    </p>
  </sourceDesc>
</fileDesc>
<encodingDesc>
  <refsDecl xml:id="biblical">
    <p>for scriptural citations</p>
    <cRefPattern
       matchPattern="(.+) (.+):(.+)"
       replacementPattern="#xpath(//div[@n='$1']/div[$2]/div[$3])">
      <p>
        This pointer pattern extracts and references the <q>book,</q>
        <q>chapter,</q> and <q>verse</q> parts of a biblical reference.
      </p>
    </cRefPattern>
    <cRefPattern matchPattern="(.+) (.+)"
       replacementPattern="#xpath(//div[@n='$1']/div[$2])">
      <p>
        This pointer pattern extracts and references the <q>book</q> and
        <q>chapter</q> parts of a biblical reference.
      </p>
    </cRefPattern>
    <cRefPattern matchPattern="(.+)" replacementPattern="#xpath(//div[@n='$1'])">
      <p>
        This pointer pattern extracts and references just the <q>book</q>
        part of a biblical reference.
      </p>
    </cRefPattern>
  </refsDecl>
</encodingDesc>
    </teiHeader>
    <text>
    <body>
    <p>
    <quote cRef="Genesis 3:9">
      And the Lord called unto <name type="m" role="biblical">Adam</name>, &amp; said
      unto him, where art thou?
    </quote>
  </p>
  <p>
    That we may, in some good Degree, have
    our Hearts affected with redeeming Love, &amp; the
    Salvation brought us by ye <choice>
      <orig>2d</orig>
      <reg>second</reg>
    </choice> <name type="m" role="biblical">Adam</name>, it may not
    be improper to take a View of our Misery
    by ye first, for which I have chosen these words&#x2014;
  </p>

  <p>
    We have here ye Voice of Mans Creator and
    Judge, making Inquisition after his Creature
    now lost &amp; by his early Disobedience fallen
    from him.
  </p>

  <p>
    God made Man upright, after his own
    Image; but being in Honor, thro' forgetting his Maker,
    he continued not, but fell from his Obedienced
    &amp; Glory, into a Vileness like that of the
    Beasts that perish.
  </p>

  <p>
    Our first parents hearkening to ye Temptation
    of ye Devil &amp; braking thro' ye divine Law by eating
    of ye forbidden fruit, soon experienced a sad
    Change in themselves. And as soon as they
    discovered it, like guilty Criminals, they attempted
    to fly from Justice.
  </p>

  <p>
    Their great Creator coming into paradise
    after ye apostasy, &amp; finding his Creatures fled,
    avoiding his presence &amp; hiding themselves among
    the Trees, he calls to one of them in these words
    of ye Text, <quote cRef="Genesis 3:9">
      "<name type="m" role="biblical">Adam</name>, where art thou?"
    </quote> which words
    may be considered&#x2014;
  </p>

  <p>
    1. As an Expression of Admiration, i.e. How
    great &amp; sudden a Change! Where! whither is
    <pb n="2"></pb> The Creature gone, which I so lately made &amp; dearly
    loved; with whom I was so well pleased, &amp; took so
    much delight; who lately above all Things desired my
    Company, &amp; rejoiced in it, placing his Life in
    my favor &amp; Love? What a strange Turn is made?
    &amp; from whence can it proceed? Is man afraid
    of his God that he thus runs from him? Is he impatient
    of my presence, weary of my Converse,
    unwilling of further Acquaintance with me, that he
    now retires at my Approach &amp; seems to hide?
    He was not wont do do so. <quote cRef="Genesis 3:9">
      "<name type="m" role="biblical">Adam</name>, where art thou?"
    </quote>
  </p>


</body>
    </text>
    </TEI>

これは翻訳されたhtmlです。以前は p タグがあった場所を確認できますが、現在は大きなスペースになっています。

    <?xml version="1.0" encoding="utf-8"?>
    <html xmlns="http://www.w3.org/1999/xhtml">
     <body style="font-family:Arial;font-size:12pt;">
        <div style="color:teal;padding:4px; background-color: rgba(255, 255, 255, .8);">
           <span style="font-weight:bold">No. 1301, Genesis 3:9<p>Jacob Cushing</p>


        Waltham, Massachusetts



      1770-09-14, 1770-09-16

  <p>



      And the Lord called unto Adam, &amp; said
      unto him, where art thou?



    That we may, in some good Degree, have
    our Hearts affected with redeeming Love, &amp; the
    Salvation brought us by ye 
      2d
      second
     Adam, it may not
    be improper to take a View of our Misery
    by ye first, for which I have chosen these words—



    We have here ye Voice of Mans Creator and
    Judge, making Inquisition after his Creature
    now lost &amp; by his early Disobedience fallen
    from him.



    God made Man upright, after his own
    Image; but being in Honor, thro' forgetting his Maker,
    he continued not, but fell from his Obedienced
    &amp; Glory, into a Vileness like that of the
    Beasts that perish.
        </p></span>
       </div>
      </body>
    </html>

望ましい出力ですが、quote、orig、reg、および name タグをすべて識別できるようにしたいです。

     <?xml version="1.0" encoding="utf-8"?>
     <html xmlns="http://www.w3.org/1999/xhtml">
      <body style="font-family:Arial;font-size:12pt;">
        <div style="color:teal;padding:4px; background-color: rgba(255, 255, 255, .8);">
           <span style="font-weight:bold">No. 1301, Genesis 3:9<p>Jacob Cushing</p>

      <p>
        Waltham, Massachusetts
      </p>

    <p>
      1770-09-14, 1770-09-16
    </p>
  <p>


    <p>
      And the Lord called unto Adam, &amp; said
      unto him, where art thou?
    </p>

  <p>
    That we may, in some good Degree, have
    our Hearts affected with redeeming Love, &amp; the
    Salvation brought us by ye 
      2d
      second
     Adam, it may not
    be improper to take a View of our Misery
    by ye first, for which I have chosen these words—
  </p>

  <p>
    We have here ye Voice of Mans Creator and
    Judge, making Inquisition after his Creature
    now lost &amp; by his early Disobedience fallen
    from him.
  </p>

  <p>
    God made Man upright, after his own
    Image; but being in Honor, thro' forgetting his Maker,
    he continued not, but fell from his Obedienced
    &amp; Glory, into a Vileness like that of the
    Beasts that perish.
   </p>
        </p></span>
       </div>
      </body>
    </html>

ここで本当に助けが必要です。また、TEI の解釈に関する優れたチュートリアルやドキュメントをご存じでしたら、よろしくお願いします。

4

1 に答える 1

0

@CM Sperberg-McQueen ありがとう!段落が正しい値で表示され、ブロックスタイルのままになるように、これをコードに追加する必要がありました。

 <xsl:template match="tei:text/tei:body/tei:p">
    <p xmlns="http://www.w3.org/1999/xhtml">
      <xsl:value-of select="."/>
    </p>
  </xsl:template>
于 2015-03-30T15:18:23.433 に答える