Lets consider an example, a = ‘red table jet blue ghost hind’. Now i want i as b = [‘red’, ‘table’, ‘jet’, ‘blue’, ‘ghost’, ‘hind’]. In python we can use list comprehension, but in Xquery is there any method like “List Comprehension” ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XQuery is based on the XDM (XPath Data Model) in which there are sequences.
A sequence is something like a flat list (it isn’t possible to have a sequence of sequences).
Here is an example:
And you can verify that
$bis a sequence exactly of the wanted strings:When the above XQUery code is run, the wanted, correct result is produced: