for the below data -
let $x := "Yahooooo !!!! Select one number - "
let $y :=
<A>
<a>1</a>
<a>2</a>
<a>3</a>
<a>4</a>
<a>5</a>
<a>6</a>
<a>7</a>
</A>
I want to get the output as -
`Yahooooo !!!! Select one number - [1 or 2 or 3 or 4 or 5 or 6 or 7]`
In XQuery 3.0, you can use ||
as a string concatenation operator:
return $x || "[" || fn:string-join($y/a, " or ") || "]"
In XQuery 1.0, you need to use fn:concat()
:
return fn:concat($x, fn:concat("[", fn:concat(fn:string-join($y/a, " or "), "]")))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With