File: gen-features-enum.xsl

package info (click to toggle)
python-aioxmpp 0.13.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 6,244 kB
  • sloc: python: 97,761; xml: 215; makefile: 155; sh: 63
file content (37 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text" encoding="utf-8" />

  <xsl:template match="root">
    <xsl:text>class Features(Enum):
    """</xsl:text>
    <xsl:for-each select="var">
      <xsl:text>
    .. attribute:: </xsl:text>
      <xsl:value-of select="translate(substring-after(name, '#'), 'abcdefghijklmnopqrstuvwxyz-', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_')" />
      <xsl:text>
       :annotation: = "</xsl:text>
      <xsl:value-of select="name" />
      <xsl:text>"

       </xsl:text>
      <xsl:value-of select="normalize-space(desc)"/>
      <xsl:text>
</xsl:text>
    </xsl:for-each>
    <xsl:text>
    """
    </xsl:text>
    <xsl:for-each select="var">
      <xsl:text>
    </xsl:text>
      <xsl:value-of select="translate(substring-after(name, '#'), 'abcdefghijklmnopqrstuvwxyz-', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_')" />
      <xsl:text> = \
        "</xsl:text>
      <xsl:value-of select="name" />
      <xsl:text>"</xsl:text>
    </xsl:for-each>
    <xsl:text>
</xsl:text>
  </xsl:template>
</xsl:stylesheet>