I have a list attribute that I'd like to use in a JSONTemplator. I am able to get the list into an array no issues, however, I want the result to be an array of integers/numbers rather than a string. If it was not a list I can use the xs:integer to try to force it to be an integer, however, I'm not quite sure how I should do this for values in a list. Any ideas on this?
Solved
JSONTemplator - Cast value types from a list?
Best answer by takashi
Hi @virtualcitymatt , a possible way is to use an XQuery expression like this. Assuming that every element of the list represents integer value.
[
for $v in fme:get-list-attribute('_list{}.number')
return xs:integer($v)
]
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.