XQuery / multiple conditions
-
I, I am trying to use XQuery on XML data and elaborated samples are few on the web. I only find small tutorials for beginners. Here is the query specification : > it's a list of "vehicle"; > each "vehicle" has "flags" nodes; > each "vehicle" is identified by a unique numeric "id" attribute; > I want to find the lowest id verifying a list of flags ; Here is a sample of data : ?xml version="1.0" encoding="UTF-8"? vehicles vehicle id="1" flags flag1/ flag2/ /flags /vehicle vehicle id="5" flags flag1/ flag2/ /flags /vehicle /vehicles Here a sample of query on one flag : (: smallest index index :) let $d := doc( $inputDocument)//vehicle let $e := $d/flags/flag1 return min( $e/../../fn:number( @id)) How to process for several flags, with "and" and "or".... Best regards