summaryrefslogtreecommitdiff
path: root/buildscripts/jGrouseDoc/skins/noframes/xslt/jsindex.xslt
blob: bddc7a42a7f0a4858a14821d548f5193618e5f5b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!-- 
	jGrouseDoc template file. Creates Javascript index
	@Copyright (c) 2007 by Denis Riabtchik. All rights reserved. See license.txt and http://jgrouse.com for details@
	$Id: jsindex.xslt 276 2007-12-09 00:50:40Z denis.riabtchik $
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	<xsl:param name='fileName' />
	<xsl:param name='rootPath' />
	<xsl:param name='version'/>	
    <xsl:param name='aux_css'>not_specified</xsl:param>
	
	<xsl:output method='text'>
	</xsl:output>
    <xsl:import href="../../common/xslt/common.xslt"/>
	
    <xsl:template match="function|constructor|ifunction|event" mode="JSwriteSummary">
        <xsl:choose>
            <xsl:when test="count(comment/inheritdesc) != 0">
                <xsl:variable name="fn"><xsl:value-of select="comment/inheritdesc/tagContent/@name"/></xsl:variable>
                <xsl:apply-templates select="/jgdoc/items/*[@id=$fn]" mode="JSwriteFuncSummary1">
                    <xsl:with-param name="origName"><xsl:value-of select="@id"/></xsl:with-param>
                    <xsl:with-param name="modifiers"><xsl:value-of select="comment/modifiers/@name"/></xsl:with-param>
                </xsl:apply-templates>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates select="." mode="JSwriteFuncSummary1">
                    <xsl:with-param name="origName"><xsl:value-of select="@id"/></xsl:with-param>
                    <xsl:with-param name="modifiers"><xsl:value-of select="comment/modifiers/@name"/></xsl:with-param>
                </xsl:apply-templates>
            </xsl:otherwise>
        </xsl:choose>       
    </xsl:template>
    
    <xsl:template match="function|constructor|ifunction|event" mode="JSwriteFuncSummary1">
        <xsl:param name="origName"/>
        <xsl:param name="modifiers"/>
        <xsl:value-of select="name()"/><xsl:text> </xsl:text>  
        <xsl:choose>
            <xsl:when test="count(comment/paramSet) != 0">
                <xsl:for-each select="comment/paramSet"><xsl:if test="position() != 1"><xsl:text>\n</xsl:text></xsl:if><xsl:if test="string-length($modifiers) != 0">
                        <xsl:value-of select="$modifiers"/><xsl:text> </xsl:text>
                        </xsl:if>
                        <xsl:if test="count(../../comment/type) != 0">
                        <xsl:apply-templates select="../../comment/type"/>
                        <xsl:text> </xsl:text>
                        </xsl:if> 
                        <xsl:value-of select="../../@localName"/>
                        <xsl:call-template name="writeFunctionParams"> 
                            <xsl:with-param name="funcName"><xsl:value-of select="../../@id"/></xsl:with-param>
                                <xsl:with-param name="paramSetCount"><xsl:value-of select="position()"/></xsl:with-param>
                        </xsl:call-template>
                </xsl:for-each> 
            </xsl:when>
            <xsl:otherwise>
                    <xsl:if test="string-length($modifiers) != 0">
                    <xsl:value-of select="$modifiers"/>
                    <xsl:text> </xsl:text></xsl:if>
                    <xsl:if test="count(comment/type) != 0">                  
                    <xsl:apply-templates select="comment/type"/>
                    <xsl:text> </xsl:text></xsl:if><xsl:value-of select="@localName"/>()</xsl:otherwise>
        </xsl:choose>
    </xsl:template>	
    
    <xsl:template match="class|namespace|struct|interface|object" mode="JSwriteSummary">
        <xsl:if test="count(comment/modifiers) != 0"><xsl:value-of select="comment/modifiers/@name"/><xsl:text> </xsl:text></xsl:if>
        <xsl:value-of select="name()"/><xsl:text> </xsl:text>
        <xsl:value-of select="@localName"/>
    </xsl:template>
    
    
    <xsl:template match="variable|property" mode="JSwriteSummary">
        <xsl:choose>
            <xsl:when test="count(comment/inheritdesc) != 0">
                <xsl:variable name="fn"><xsl:value-of select="comment/inheritdesc/tagContent/@name"/></xsl:variable>
                <xsl:apply-templates select="/jgdoc/items/*[@id=$fn]" mode="JSwriteVarSummary1">
                    <xsl:with-param name="origName"><xsl:value-of select="@id"/></xsl:with-param>
                </xsl:apply-templates>
            </xsl:when>
            <xsl:otherwise>
                <xsl:apply-templates select="." mode="JSwriteVarSummary1">
                    <xsl:with-param name="origName"><xsl:value-of select="@id"/></xsl:with-param>
                </xsl:apply-templates>
            </xsl:otherwise>
        </xsl:choose>       
    </xsl:template>
    
    <xsl:template match="variable|property" mode="JSwriteVarSummary1">
        <xsl:param name="origName"/>
            <xsl:value-of select="name()"/><xsl:text> </xsl:text>
            <xsl:if test="count(comment/type) != 0">
            <xsl:apply-templates select="comment/type"/>
            <xsl:text> </xsl:text></xsl:if>
            <xsl:value-of select="@localName" />
    </xsl:template>
    
    	

	<xsl:template match="/">
/*Generated by jGrouseDoc*/
(function()
{
    var data = [<xsl:for-each select="/jgdoc/items/*[@elementType != 'phys_container']//comment"><xsl:sort select="@localName"/><xsl:if test="position() != 1">,</xsl:if>
        <xsl:call-template name="writeJS"/>
    </xsl:for-each>];
    jgdoc.setData(data);
    
})()
	</xsl:template>
	
	<xsl:template name="writeJS">
	   {
	       localName : "<xsl:value-of select="../@localName"/>",
	       fullName : "<xsl:value-of select="../@id"/>",
	       summary : "<xsl:apply-templates select=".." mode="JSwriteSummary"/>",
	       ref : "<xsl:call-template name="writeLink"><xsl:with-param name="refName"><xsl:value-of select="../@id"/></xsl:with-param></xsl:call-template>",
	       parent : "<xsl:value-of select="../@parentName"/>",
	       type : "<xsl:value-of select="name(..)"/>",
	       elementType : "<xsl:value-of select="../@elementType"/>"
	       
	   }
	</xsl:template>
</xsl:stylesheet>