Product SiteDocumentation Site

6.10. jn:members

This functions returns all values that are in all arrays of an input sequence, preserving the order. Non-arrays in the input sequence are ignored.
        declare function jn:members($arg as item()*) as item()* {
          for $array in $arg[. instance of array()]
          for $position in 1 to jn:size($array)
          return $array($position)
        };
Example 6.7. Retrieving the members of an array
Query:
          let $planets :=  ( "foo", { "foo" : "bar "}, [ "mercury", "venus", "earth", "mars" ], [ 1, 2, 3 ])
          return jn:members($planets)
Result:
mercury venus earth mars 1 2 3