Second “value of” should reflect y, I think:

let ${$x, $y, $z} := { 'x': 1, 'y': 2 }
return (
  'Value of x', $x,
  'Value of y', $y,
  'Value of z (empty sequence)', $z
)

 

 

Cheers,

 

E.

_____________________________________________

Eliot Kimber

Sr. Staff Software Engineer

O: 512 554 9368

 

servicenow

 

servicenow.com

LinkedIn | X | YouTube | Instagram

 

From: Martin Honnen via BaseX-Talk <basex-talk@mailman.uni-konstanz.de>
Date: Monday, May 4, 2026 at 5:23
PM
To: BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: [basex-talk] Slight error in code sample in https://docs.basex.org/13/XQuery_4.0#destructuring

[External Email]


I think the code sample given in
https://docs.basex.org/13/XQuery_4.0#destructuring as

let ${$x, $y} := { 'x': 1, 'y': 2 }
return (
  'Value of x', $x,
  'Value of z', $y,
  'Value of z (empty sequence)', $z
)

needs to be corrected to

let ${$x, $y, $z} := { 'x': 1, 'y': 2 }
return (
  'Value of x', $x,
  'Value of z', $y,
  'Value of z (empty sequence)', $z
)