Forum Stats

  • 3,875,435 Users
  • 2,266,915 Discussions


Is it possible to define list in XQuery ?

NicePseronMahou Member Posts: 19
edited May 15, 2013 9:34AM in XQuery
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


This discussion has been closed.