Skip to main content

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?

Hi @virtualcitymatt​ , a possible way is to use an XQuery expression like this. Assuming that every element of the list represents integer value.

e
    for $v in fme:get-list-attribute('_list{}.number')
    return xs:integer($v)
]

 


Hi @virtualcitymatt​ , a possible way is to use an XQuery expression like this. Assuming that every element of the list represents integer value.

e
    for $v in fme:get-list-attribute('_list{}.number')
    return xs:integer($v)
]

 

And that is why they call you the best. Thanks @Takashi Iijima​ . 


Reply