XQuery distinct values with where clause problem
问题 I'm very new to XQuery so excuse me if I am somehow missing something. I am trying to extract data where certain sub-nodes of an element are DISTINCT, as well as where a certain sibling node's is equal to some predefined string for $product in fn:distinct-values(document('cpwdoc')/root/package/properties/value[@key="product"]) where document('cpwdoc')/root/package/categories/category[@name="Cheap"] return $product The XML I am querying looks like this: <root> <package> <title>Some package 1<