summaryrefslogtreecommitdiff
path: root/metadata/schemas.xslt
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@beryl-project.org>2007-06-11 20:55:06 +0200
committerDennis Kasprzyk <onestone@beryl-project.org>2007-06-11 20:55:06 +0200
commit6c584e3f6831f59abd1265ec90312aa0189fd3d5 (patch)
treee28a194423ec76001cecfffcc61306b40f4e6fd9 /metadata/schemas.xslt
parentadc6bf15d801ec978f7a63f861dcc2f4b0987ea0 (diff)
Add int descriptions to long option description.
Diffstat (limited to 'metadata/schemas.xslt')
-rw-r--r--metadata/schemas.xslt18
1 files changed, 17 insertions, 1 deletions
diff --git a/metadata/schemas.xslt b/metadata/schemas.xslt
index b15fb0d8..d1c71437 100644
--- a/metadata/schemas.xslt
+++ b/metadata/schemas.xslt
@@ -269,9 +269,12 @@
<xsl:variable name="info">
<xsl:text> (</xsl:text>
<xsl:choose>
- <xsl:when test="contains('int,float',@type)">
+ <xsl:when test="contains('int,float',@type) and not(desc/value/text())">
<xsl:value-of select="min/text()"/> - <xsl:value-of select="max/text()"/>
</xsl:when>
+ <xsl:when test="@type='int' and desc/value/text()">
+ <xsl:call-template name="printIntDescList"/>
+ </xsl:when>
<xsl:when test="@type = 'match'">
<xsl:text>match</xsl:text>
</xsl:when>
@@ -282,6 +285,19 @@
<xsl:value-of select="$info"/>
</xsl:if>
</xsl:template>
+
+ <!-- generates a list of int descriptions -->
+ <xsl:template name="printIntDescList">
+ <xsl:variable name="list">
+ <xsl:for-each select="desc">
+ <xsl:value-of select="value/text()"/>
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="name/text()"/>
+ <xsl:text>, </xsl:text>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="substring($list,1,string-length($list) - 2)"/>
+ </xsl:template>
<!-- generates a default number out of the min and max values -->
<xsl:template name="printNumFallback">