Re: [xsl] Generating an index of terms in a TEI P5 book MS

Subject: Re: [xsl] Generating an index of terms in a TEI P5 book MS
From: "Charles Muller acmuller@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 12 Jun 2016 12:32:55 -0000
On 6/12/2016 9:24 PM, Martin Honnen martin.honnen@xxxxxx wrote:

With a default namespace declaration like
   xmlns="http://www.tei-c.org/ns/1.0";
in place in the input XML with an XSLT 1.0 processor you need

<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:template match="tei:TEI/tei:text/tei:body">
      <html>
      <head/>
       <body>
         <xsl:for-each select="//tei:term[@xml:lang='zh'] ">
         <xsl:sort select="."/>
           <p><xsl:apply-templates/><xsl:text> </xsl:text></p>
           </xsl:for-each>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

Yes! And it sorts:


<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   </head>
   <body>
      <p>d8d= </p>
      <p>d8d> </p>
      <p>d8e </p>
      <p>d8e </p>
      <p>d8e </p>
      <p>d8e </p>
      <p>d8e </p>


I wonder if there is a way to eliminate the doubled entries with XSLT?


In any case, thank you so much.


Chuck



--------------------------- A. Charles Muller

Graduate School of Humanities and Sociology
Faculty of Letters
University of Tokyo
7-3-1 HongE
, BunkyE
-ku
Tokyo 113-8654, Japan

Office Phone: 03-5841-3735

Web Site: Resources for East Asian Language and Thought
http://www.acmuller.net

Twitter: @H_Buddhism

Current Thread