Link to home
Start Free TrialLog in
Avatar of Darius
DariusFlag for Lithuania

asked on

XSLT 1.0 - Finding Substrings from the End of a String

Hi Guys,

Please advice,  how to use substring function and get result of ten last characters from the end?

 input = 11234567899
<xsl:variable name="lotNumber" select="LotNumber[string-length(normalize-space())>10]" />
<xsl:value-of select="substring(normalize-space($lotNumber),1,10)"/>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Darius

ASKER

@Netminder,
Thank you for assistance...
 it has been tested and it works as expected.
Avatar of Darius

ASKER

Small update, please see details below
There is no technically difference after removing '10'. Both ways is worked
<xsl:value-of select="substring(normalize-space($lotNumber),string-length(normalize-space($lotNumber))-9,10)"/>
<xsl:value-of select="substring(normalize-space($lotNumber),string-length(normalize-space($lotNumber))-9)"/>

Open in new window