summaryrefslogtreecommitdiff
path: root/Build/cdbuild/tpm2tpm.xsl
blob: 90139806e44ef076a11503320d4a2e334ff23d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0"?> 
<xsl:stylesheet 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:TPM="http://texlive.dante.de/"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  resultns="">
 
<xsl:template match="/">
    <xsl:apply-templates/>
</xsl:template>         


<xsl:template match="TPM:Title"/>

<xsl:template match="TPM:Description"/>

<xsl:template match="rdf:Description">
<xsl:variable name="Name">
 <xsl:text>/texlive/Master/texmf-dist/doc/html/catalogue/entries/</xsl:text>
 <xsl:value-of select="TPM:Name"/>
 <xsl:text>.xml</xsl:text>
</xsl:variable>
 <xsl:copy>  
    <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
    <xsl:for-each select="document($Name)">
     <TPM:Title>
      <xsl:value-of select="entry/about/caption"/>
     </TPM:Title>
     <TPM:Description>
      <xsl:value-of select="entry/description/abstract"/>
     </TPM:Description>
    </xsl:for-each>
 </xsl:copy>
 
</xsl:template>

<xsl:template match="text()">
    <xsl:value-of select="."/> <!-- could normalize() here -->
  </xsl:template>

<xsl:template match="*|@*|comment()|processing-instruction()">
      <xsl:copy>
          <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
      </xsl:copy>
</xsl:template>
    

</xsl:stylesheet>