Closed waldoj closed 8 years ago
Looks like substring(string,start,len)
is the way to do this. I'm thinking something like (barely-better-than-pseudocode follows):
<xsl:if test="substring(heading/desig,-1,1) = '.'">
<xsl:attribute name="prefix">
<xsl:variable name="prefix-length" select="string-length(heading/desig)"/>
<xsl:value-of name="prefix-cropped" select="substring(heading/desig,prefix-length,prefix-length-1)"/>
</xsl:attribute>
</xsl:if>
I have no idea why that fix works. Trimming heading/desig
to its string length should make no difference whatsoever. It should be the string length minus one. And yet.
This line is over-broad:
It's stripping all periods from section headers, instead of just trailing periods.