从 XML TEI 文件中提取数据

问题描述

我正在使用 TEI XML 文件完成小说的编码。我想用XSLT提取每章的字符,标记为:

<name type="character" key="nameofthecharacter">Name</name>

结构如下:

  </teiHeader>
    <text>
      <body>
        <div n='firstchapter' type='chapter'>
           <head>title</head>
              <p><name type="character" key="Sam">Sam</name> is a character        
              </p>
        </div>
        <div n='secondchapter' type='chapter'>
           <head>title</head>
              <p><name type="character" key="Elody">Elody</name>                           is a character
    </body>
  </text>
</TEI>

我尝试了基本的 XSLT,例如:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0">
         <xsl:output method="text"/>
         <xsl:template match="/TEI/text/body/div[@type = 'book']"/>
             <xsl:apply-templates select="name[@type = "character"/>
   </xsl:template>
</xsl:stylesheet>

但似乎不是正确的语法使用。有什么建议吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)