Hi, I have a template that takes a string and makes it title case. for example:
"the man and the moon (MATM)"
will display:
"The Man And The Moon (Matm)"
I need to be able to ignore contractions (and, or) and acronyms (MATM)
I would like the output to be:
"The Man and The Moon (MATM)"
Here is my current template:
Code:
<xsl:template name="titlecase">
<xsl:param name="text" as="xs:string"/>
<xsl:sequence select="string-join(for $x in tokenize($text,'\s') return concat(upper-case(substring($x, 1, 1)), lower-case(substring($x, 2))), ' ')"/>
</xsl:template>
I am not sure whats the best approach.
Thanks for the help.