This discussion is archived
3 Replies Latest reply: May 15, 2013 6:34 AM by 845924 RSS

Is it possible to define list in XQuery ?

NicePseronMahou Newbie
Currently Being Moderated
Hi everybody,
I wish my question could be easy to someone.
Consider the following XML document:

<article id="1" quantity="5"/>
<article id="2" quantity="4"/>
<article id="3" quantity="2"/>
<article id="4" quantity="7"/>

This document is updated each time a new import is done.
I maintain a list of old quantities, for example, old = {4,4,2,7}+ indicates that only the first article has been updated.

For this purpose, I am trying to define a list in XQuery+ as follows: *$old := [4, 4, 2, 7]*,
and i want to use it in order to detect all updated articles, like: *//article[@quantity < $old[@id]]*.
Does someone know how to declare a list and use it during the evaluation of documents like presented above ?

King regards.

Edited by: NicePseronMahou on Feb 28, 2012 10:15 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points