Skip to content

Instantly share code, notes, and snippets.

@jcfr
Last active September 27, 2015 17:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jcfr/1303059 to your computer and use it in GitHub Desktop.
Save jcfr/1303059 to your computer and use it in GitHub Desktop.
slicer-4.0-module-parameterdescription.xslThe XSLT understands nested parameter tag (Thanks Julien)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" encoding="UTF-8"/>
<xsl:template name="newline"><xsl:text>&#10;</xsl:text></xsl:template>
<!-- See http://na-mic.org/Mantis/view.php?id=2536 -->
<xsl:template match="name"> (<xsl:value-of select="."/>)</xsl:template>
<xsl:template match="/executable">
<xsl:for-each select="parameters">
<xsl:text>* '''</xsl:text><xsl:value-of select="label"/>'''<xsl:apply-templates select="name"/><xsl:text>: </xsl:text><xsl:value-of select="description"/><xsl:call-template name="newline"/>
<xsl:for-each select="*[descendant::label]">
<xsl:text>** '''</xsl:text><xsl:value-of select="label"/>'''<xsl:apply-templates select="name"/><xsl:text>: </xsl:text><xsl:value-of select="description"/><xsl:call-template name="newline"/>
<xsl:for-each select="*[descendant::label]">
<xsl:text>*** '''</xsl:text><xsl:value-of select="label"/>'''<xsl:apply-templates select="name"/><xsl:text>: </xsl:text><xsl:value-of select="description"/><xsl:call-template name="newline"/>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:transform>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment