For the project I am stuck with XSLT-1.0 / XPATH-1.0 and you need a quick way to remove the string prefix from the attribute values.
Example attribute values:
"cmdValue1", "gfValue2", "dTestCase3"
The values I need are:
"Value1", "Value2", "TestCase3"
I came up with this XPath expression, but it's too slow for my application:
substring(@attr, 1 + string-length(substring-before(translate(@attr, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '..........................'), '.')))
In essence, the above replaces all uppercase characters with dots, and then creates a substring from the original attribute value, starting with the first dot found (the first capital letter char).
Does anyone know a shorter / faster way to do this in XSLT-1.0 / XPATH-1.0?
source
share