summaryrefslogtreecommitdiff
path: root/gnuradio-core/doc/xml/swig.xsl
blob: 6163c2d9f6384bc527a894f76d7a7d4e178f7149 (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
<!-- XSLT script to extract document for class/function for swig docstring
     If you have xsltproc you could use:
     xsltproc swig.xsl index.xml > swig_doc.i
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text"/>
   <xsl:template match="/">
      <!-- process each compound -->
      <xsl:for-each select="doxygenindex/compound">
        <xsl:apply-templates select="document( concat( @refid, '.xml' ) )/*" />
      </xsl:for-each>
   </xsl:template>

  <xsl:template match="doxygen">
    <xsl:for-each select="compounddef[@kind='class']">  
      <xsl:text>%feature(__QuOtE__docstring__QuOtE__) </xsl:text>
      <xsl:value-of select="compoundname"/>
      <xsl:text> __QuOtE__ &#10;</xsl:text>
      <xsl:value-of select="briefdescription"/><xsl:text>
      </xsl:text>
      <xsl:value-of select="detaileddescription"/>
      <xsl:text> see also: </xsl:text>
      <xsl:value-of select="includes"/>
      <xsl:text>__QuOtE__;&#10;&#10;</xsl:text>

      <!-- output for each function individually -->
      <xsl:for-each select="*/memberdef[@kind='function' and not(starts-with(name,'operator'))]"> 
        <xsl:text>%feature(__QuOtE__docstring__QuOtE__) </xsl:text><xsl:value-of select="../../compoundname"/>::<xsl:value-of select="name"/>
        <xsl:text> __QuOtE__&#10;</xsl:text>
        <xsl:value-of select="definition"/> <xsl:value-of select="argsstring"/>
        <xsl:text>
        </xsl:text><xsl:value-of select="briefdescription"/><xsl:text>
        </xsl:text><xsl:value-of select="detaileddescription"/>
        <xsl:text>__QuOtE__; &#10;&#10;</xsl:text>
      </xsl:for-each>
    </xsl:for-each>  
  </xsl:template>
</xsl:stylesheet>