I have some simple strings:
Ex:
DeFacto, RightOfWay, HalfYearly etc
How can i insert a space between the lowercase and the uppercase using a function in xslt 2.0 or xslt 3.0.
Desire output:
De Facto, Right Of Way, Half Yearly
You can use the replace
function: replace('DeFacto, RightOfWay, HalfYearly', '(\p{Ll})(\p{Lu})', '$1 $2')
gives De Facto, Right Of Way, Half Yearly
.
Using the code provided i've made a function for the replacement.
<xsl:function name="fn:InsertSpace">
<xsl:param name="Text" />
<xsl:value-of select="replace($Text, '(\p{Ll})(\p{Lu})', '$1 $2')"/>
</xsl:function>