我XQuery中的数组:如何在XQuery中连接数组值?
let $arr := array {"Foo", "Bar"}
我想用分离器;
加入数组值,这样我得到的字符串
"Foo;Bar"
如何实现这一目标?
我XQuery中的数组:如何在XQuery中连接数组值?
let $arr := array {"Foo", "Bar"}
我想用分离器;
加入数组值,这样我得到的字符串
"Foo;Bar"
如何实现这一目标?
你也使用$arr?*
(https://www.w3.org/TR/xquery/#id-postfix-lookup)获得的序列然后使用string-join
,因为您已经找到:string-join($arr?*, ';')
。
对于嵌套数组,您可能需要使用array:flatten
https://www.w3.org/TR/xpath-functions/#func-array-flatten。
我已经与fn:data
将数组成序列,然后再在这个顺序使用fn:string-join
找到了一个方法:
string-join(data($arr), ";")