| 1 |
<xsl:stylesheet version="1.0" |
|---|
| 2 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|---|
| 3 |
<xsl:output omit-xml-declaration="yes"/> |
|---|
| 4 |
|
|---|
| 5 |
<xsl:template name="wrap-string"> |
|---|
| 6 |
<xsl:param name="str" /> |
|---|
| 7 |
<xsl:param name="wrap-col" /> |
|---|
| 8 |
<xsl:param name="break-mark" /> |
|---|
| 9 |
<xsl:param name="pos" select="0" /> |
|---|
| 10 |
<xsl:choose> |
|---|
| 11 |
<xsl:when test="contains( $str, ' ' )"> |
|---|
| 12 |
<xsl:variable name="before" select="substring-before( $str, ' ' )" /> |
|---|
| 13 |
<xsl:variable name="pos-now" select="$pos + string-length( $before ) + 1" /> |
|---|
| 14 |
<xsl:choose> |
|---|
| 15 |
<xsl:when test="$pos = 0" /> |
|---|
| 16 |
<xsl:when test="floor( $pos div $wrap-col ) != floor( $pos-now div $wrap-col )"> |
|---|
| 17 |
<xsl:text xml:spacing="preserve"> |
|---|
| 18 |
</xsl:text><xsl:copy-of select="$break-mark" /> |
|---|
| 19 |
</xsl:when> |
|---|
| 20 |
<xsl:otherwise> |
|---|
| 21 |
<xsl:text> </xsl:text> |
|---|
| 22 |
</xsl:otherwise> |
|---|
| 23 |
</xsl:choose> |
|---|
| 24 |
|
|---|
| 25 |
<xsl:value-of select="$before" /> |
|---|
| 26 |
|
|---|
| 27 |
<xsl:call-template name="wrap-string"> |
|---|
| 28 |
<xsl:with-param name="str" select="substring-after( $str, ' ' )" /> |
|---|
| 29 |
<xsl:with-param name="wrap-col" select="$wrap-col" /> |
|---|
| 30 |
<xsl:with-param name="break-mark" select="$break-mark" /> |
|---|
| 31 |
<xsl:with-param name="pos" select="$pos-now" /> |
|---|
| 32 |
</xsl:call-template> |
|---|
| 33 |
</xsl:when> |
|---|
| 34 |
<xsl:otherwise> |
|---|
| 35 |
<xsl:variable name="pos-now" select="$pos + string-length( $str )" /> |
|---|
| 36 |
<xsl:choose> |
|---|
| 37 |
<xsl:when test="floor( $pos div $wrap-col ) != floor( $pos-now div $wrap-col )"> |
|---|
| 38 |
<xsl:text xml:spacing="preserve"> |
|---|
| 39 |
</xsl:text><xsl:copy-of select="$break-mark" /> |
|---|
| 40 |
</xsl:when> |
|---|
| 41 |
<xsl:otherwise> |
|---|
| 42 |
<xsl:text> </xsl:text> |
|---|
| 43 |
</xsl:otherwise> |
|---|
| 44 |
</xsl:choose> |
|---|
| 45 |
<xsl:value-of select="$str" /> |
|---|
| 46 |
</xsl:otherwise> |
|---|
| 47 |
</xsl:choose> |
|---|
| 48 |
</xsl:template> |
|---|
| 49 |
|
|---|
| 50 |
<xsl:template match="parameter" name="configparams" xml:space="preserve"> |
|---|
| 51 |
name: <xsl:value-of select="@name"/> (<xsl:value-of select="@required"/>) <xsl:if test="@default">[<xsl:value-of select="@default"/>]</xsl:if> |
|---|
| 52 |
allowed: /^<xsl:value-of select="@allowed"/>$/ |
|---|
| 53 |
<xsl:call-template name="wrap-string" xml:space="default"> |
|---|
| 54 |
<xsl:with-param name="str" select="."/> |
|---|
| 55 |
<xsl:with-param name="break-mark" select="' '"/> |
|---|
| 56 |
<xsl:with-param name="wrap-col" select="'66'"/> |
|---|
| 57 |
</xsl:call-template> |
|---|
| 58 |
</xsl:template> |
|---|
| 59 |
|
|---|
| 60 |
<xsl:param name="example" select="0"/> |
|---|
| 61 |
<xsl:template match="/">= <xsl:value-of select="module/name"/> = |
|---|
| 62 |
|
|---|
| 63 |
<xsl:for-each select="module/description/*"> |
|---|
| 64 |
<xsl:text xml:spacing="preserve"> </xsl:text> |
|---|
| 65 |
<xsl:call-template name="wrap-string"> |
|---|
| 66 |
<xsl:with-param name="str" select="."/> |
|---|
| 67 |
<xsl:with-param name="break-mark" select="' '"/> |
|---|
| 68 |
<xsl:with-param name="wrap-col" select="'70'"/> |
|---|
| 69 |
</xsl:call-template> |
|---|
| 70 |
<xsl:text xml:spacing="preserve"> |
|---|
| 71 |
|
|---|
| 72 |
</xsl:text> |
|---|
| 73 |
</xsl:for-each> |
|---|
| 74 |
|
|---|
| 75 |
loader: <xsl:value-of select="module/loader"/> |
|---|
| 76 |
<xsl:if test="module/image">, image: <xsl:value-of select="module/image"/> </xsl:if> |
|---|
| 77 |
<xsl:if test="module/object">, object: <xsl:value-of select="module/object"/> </xsl:if> |
|---|
| 78 |
|
|---|
| 79 |
=== Module Configuration === |
|---|
| 80 |
<xsl:choose> |
|---|
| 81 |
<xsl:when test="module/moduleconfig/parameter"> |
|---|
| 82 |
<xsl:for-each select="module/moduleconfig/parameter"> |
|---|
| 83 |
<xsl:call-template name="configparams" /> |
|---|
| 84 |
</xsl:for-each> |
|---|
| 85 |
</xsl:when> |
|---|
| 86 |
<xsl:otherwise>No module-level options available for this module.</xsl:otherwise> |
|---|
| 87 |
</xsl:choose> |
|---|
| 88 |
|
|---|
| 89 |
=== Check Configuration === |
|---|
| 90 |
<xsl:choose> |
|---|
| 91 |
<xsl:when test="module/checkconfig/parameter"> |
|---|
| 92 |
<xsl:for-each select="module/checkconfig/parameter"> |
|---|
| 93 |
<xsl:call-template name="configparams" /> |
|---|
| 94 |
</xsl:for-each> |
|---|
| 95 |
</xsl:when> |
|---|
| 96 |
<xsl:otherwise>No check-level options available for this module.</xsl:otherwise> |
|---|
| 97 |
</xsl:choose> |
|---|
| 98 |
|
|---|
| 99 |
<xsl:if test="$example != 0"> |
|---|
| 100 |
== Examples == |
|---|
| 101 |
<xsl:for-each select="module/examples/example"><xsl:value-of disable-output-escaping="yes" select="."/></xsl:for-each> |
|---|
| 102 |
</xsl:if> |
|---|
| 103 |
</xsl:template> |
|---|
| 104 |
</xsl:stylesheet> |
|---|