
| Key: |
SRC-420
|
| Type: |
Improvement
|
| Status: |
Open
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Michael Collas
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
File Attachments:
|
1.
patch_iedoc2ruby (9 kb)
|
|
|
The 'underscorify' template is unnecessarily long. It can be reduced to something relatively simple.
<xsl:template name="underscorify">
<xsl:param name="input" />
<xsl:if test="$input">
<xsl:variable name="first-char" select="substring($input, 1, 1)"/>
<xsl:variable name="lower-first-char" select="translate($first-char, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
<xsl:if test="$first-char != $lower-first-char">
<xsl:text>_</xsl:text>
</xsl:if>
<xsl:value-of select="$lower-first-char"/>
<xsl:call-template name="underscorify">
<xsl:with-param name="input" select="substring($input, 2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
|
|
Description
|
The 'underscorify' template is unnecessarily long. It can be reduced to something relatively simple.
<xsl:template name="underscorify">
<xsl:param name="input" />
<xsl:if test="$input">
<xsl:variable name="first-char" select="substring($input, 1, 1)"/>
<xsl:variable name="lower-first-char" select="translate($first-char, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
<xsl:if test="$first-char != $lower-first-char">
<xsl:text>_</xsl:text>
</xsl:if>
<xsl:value-of select="$lower-first-char"/>
<xsl:call-template name="underscorify">
<xsl:with-param name="input" select="substring($input, 2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template> |
Show » |
|