2 The first stylesheet to be used, this file cleans up the structure
3 of the Lisp-generated XML file by extracting elements from all
4 docstrings into their parent elements, so that only the textual
5 description remains in the <documentation-string>.
9 <class-definition name="foo">
12 <documentation-string>
14 <see-slot id="foo">See also the foo function.</see-slot>
16 </documentation-string>
21 <class-definition name="foo">
26 <see id="foo">See also the foo function.</see>
30 <documentation-string>
33 </documentation-string>
38 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
39 <xsl:output method=
"xml" indent=
"yes"/>
41 <xsl:template match=
"@*|node()">
43 <xsl:apply-templates select=
"@*|node()"/>
47 <xsl:template match=
"see"/>
48 <xsl:template match=
"see-slot"/>
49 <xsl:template match=
"see-constructor"/>
50 <xsl:template match=
"arg"/>
51 <xsl:template match=
"return"/>
52 <xsl:template match=
"implementation-note"/>
53 <xsl:template match=
"section"/>
55 <xsl:template mode=
"extract" match=
"@*|node()">
57 <xsl:apply-templates select=
"@*|node()"/>
61 <xsl:template mode=
"extract" match=
"see-slot">
63 <xsl:apply-templates select=
"@*"/>
64 <xsl:apply-templates/>
68 <xsl:template mode=
"extract" match=
"see-constructor">
70 <xsl:apply-templates select=
"@*"/>
71 <xsl:apply-templates/>
75 <xsl:template mode=
"auto-see" match=
"class|fun|variable">
77 <xsl:apply-templates select=
"@*"/>
79 <xsl:sort select=
"@name" data-type=
"text" order=
"ascending"/>
80 </xsl:apply-templates>
84 <xsl:template match=
"class-definition
86 |variable-definition">
87 <xsl:if test=
"not(.//unexport)">
89 <xsl:apply-templates select=
"@*|node()"/>
94 <xsl:template match=
"documentation-string">
95 <xsl:if test=
".//arg">
97 <xsl:apply-templates mode=
"extract" select=
".//arg"/>
101 <xsl:if test=
".//section">
103 <xsl:apply-templates mode=
"extract" select=
".//section"/>
107 <xsl:if test=
".//see or .//see-slot or .//see-constructor
108 or .//class or .//fun or .//variable">
110 <xsl:if test=
".//class or .//fun or .//variable">
112 <xsl:apply-templates mode=
"auto-see"
113 select=
".//class|.//fun|.//variable"/>
117 <xsl:if test=
".//see">
119 <xsl:apply-templates mode=
"extract" select=
".//see"/>
123 <xsl:if test=
".//see-slot">
125 <xsl:apply-templates mode=
"extract" select=
".//see-slot"/>
129 <xsl:if test=
".//see-constructor">
131 <xsl:apply-templates mode=
"extract" select=
".//see-constructor"/>
137 <xsl:apply-templates mode=
"extract" select=
".//implementation-note"/>
138 <xsl:apply-templates mode=
"extract" select=
".//return"/>
140 <documentation-string>
141 <xsl:apply-templates/>
142 </documentation-string>