how to use substring when extracting value in TN under Document Type -> Extract

Hi

I would like to extract only a substring of the value that I receive when using the Query function in TN under Document Type → Extract.

When using this query:
/tfe:OIOAnkomstdeklarationOpdater_I[0]/tfe:InputListe[0]/dka87a:DKA87A[0]/MesIdeMES19[0]

I get this: 12345678_111

I only want to extract the first 8 characters. I tried this:

substring-before(/tfe:OIOAnkomstdeklarationOpdater_I[0]/tfe:InputListe[0]/dka87a:DKA87A[0]/MesIdeMES19[0],‘_’)

But that gives me an error.

Any suggestions?

Kind regards Mikael

this doesn’t work either:
/tfe:OIOAnkomstdeklarationOpdater_I[0]/tfe:InputListe[0]/dka87a:DKA87A[0]/[substring(MesIdeMES19[0],‘0’,‘8’]

Did you take a look more in the XQL query documentation present part of TN BIS or TN Core user guides?

HTH,
RMG

Thanks for a great tip.

I found this:

The following XPath functions are currently not supported, but can be implemented using
Tamino server extensions, as long as they do not have a variable number of arguments:

concat
contains
id
lang
local-name
namespace-uri
normalize-space
string-length
substring
substring-after
substring-before
translate

kind regards Mikael

OK make sense!

under doc type def, you can apply transformation, just wrap a substring function under your transformation service, then you will get whatever you want.