Hi,

 

I'm trying to create a query to return distinct element values.  I've done
this before but this time the element resides in a document fragment.  In
the query below the 'column' element is in a fragment so I included the
document-fragment-query in the constraining query. 

 

Something is not correct as an empty sequence is being returned.

 

xquery version "1.0-ml";
declare default element namespace
'http://developer.envisn.com/xmlns/envisn/netvisn/'; 

let $modelKey := 'i627DE1CC4CF94F73ACAB3D27953C5D3C' 

let $cq :=

  cts:and-query((
    cts:directory-query("/db/netvisn/content/","infinity"),
    cts:element-value-query(xs:QName("contentKey"), $modelKey, "exact"),
    cts:document-fragment-query(cts:element-value-match(xs:QName("column"),
"?"))

  ))
              
let $columns := cts:element-values(xs:QName("column"),"", (), $cq)          
for $column in $columns return $column



This query does return values though:

 

return cts:search(doc(), $cq)//column

 

<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>CITY</column>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>COMPANYNAME</colum
n>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>COUNTRY</column>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>REGIONID</column>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>COUNTRY</column>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>COUNTRY</column>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>COUNTRY</column>
<column
xmlns="http://developer.envisn.com/xmlns/envisn/netvisn/";>CITY</column>



Thanks for any assistance,

gary

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to