|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Testing the Last Character of a String
I'd like to test the last character in a node text-string. If it's a
period, then insert the value and a space. If it's not a period, then
insert the value, a period., and a space. I think I've gotten most of
the code right, but don't have it quite right, as it's not working. Any tips?
Thanks,
Nathan
<xsl:choose>
<xsl:when test="substring(archdesc/did/unittitle/text(),
string-length(archdesc/did/unittitle), 1)=.">
<xsl:value-of select="normalize-space(archdesc/did/unittitle)"/>
<xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(archdesc/did/unittitle)"/>
<xsl:text>. </xsl:text>
</xsl:otherwise>
</xsl:choose>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








