aboutsummaryrefslogtreecommitdiff
path: root/shunit2-2.0.3/share/resources/shelldoc.xslt
blob: 45d5f92c09cf18950fd12c7990d88e022d01d9b7 (about) (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<!--
example ways to process this xslt:
$ java -cp xalan-2.6.0.jar \
  org.apache.xalan.xslt.Process -xml -in log4sh.xml -xsl shelldoc.xslt

$ xsltproc shelldoc.xslt log4sh.xml |xmllint -noblanks -
-->
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:s="http://www.forestent.com/projects/shelldoc/xsl/2005.0">
  <xsl:output
      method="xml"
      version="1.0"
      encoding="UTF-8"
      indent="yes"/>
  <xsl:strip-space elements="*" />

  <xsl:variable name="newline">
<xsl:text>
</xsl:text>
  </xsl:variable>

  <xsl:key name="groups" match="s:function" use="@group" />

  <xsl:template match="/">
    <chapter id="shelldoc" lang="en-US"><title>Function Reference</title>
    <xsl:for-each select="//s:function[generate-id(.)=generate-id(key('groups', @group)[1])]">
      <xsl:sort select="@group" />

      <section>
        <xsl:attribute name="id">shelldoc-section-<xsl:value-of select="@group" /></xsl:attribute>
        <title><xsl:value-of select="@group"/></title>
        <table>
          <xsl:attribute name="id">shelldoc-function-<xsl:value-of select="@group" /></xsl:attribute>
          <title><xsl:value-of select="@group"/></title>
          <tgroup cols="2"><tbody>
          <xsl:for-each select="key('groups', @group)">
            <!--<xsl:sort select="entry/funcsynopsis/funcprototype/funcdef/function" />-->
            <xsl:choose>
              <xsl:when test="@modifier">
                <xsl:if test="@modifier != 'private'">
                  <row valign="top">
                    <xsl:copy-of select="entry" />
                    <!--<xsl:apply-templates select="entry" />-->
                  </row>
                </xsl:if>
              </xsl:when>
              <xsl:otherwise>
                <row valign="top">
                  <xsl:copy-of select="entry" />
                  <!--<xsl:apply-templates select="entry" />-->
                </row>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
          </tbody></tgroup>
        </table>
      </section>
    </xsl:for-each>
    </chapter>
  </xsl:template>

  <xsl:template match="entry">
    <entry>
    <xsl:copy-of select="*" />
    </entry>
  </xsl:template>

</xsl:stylesheet>