Hi Rob,

Maps in XQuery have been defined to be unordered. Using sequences (or arrays) of maps is one way to preserve order. You could also have a look at Leo’s awesome data structures written in XQuery (look for ordered-map.xqm):


Cheers,
Christian


On Tue, Mar 2, 2021 at 10:35 AM Rob Stapper <r.stapper@lijbrandt.nl> wrote:

Hi Christian,

 

In my casus I’m exporting and importing  xQuery maps where the export-format is a xQuery-file or a json-file. Hereby the sequence of the exported map-entries is important: I want the sequence in which the entries are generated to stay in tact when exporting. I can’t get this working.

 

My current work-around is to place the map-entries in an array. It does the trick but it feels redundant.

Is there a way to have this kind of control over map-entry sequence?

 

Thnx in advance,

Rob Stapper

 

Sent from Mail for Windows 10 

 


Virus-free. www.avast.com