15.07.2016 Views

MARKLOGIC SERVER

Inside-MarkLogic-Server

Inside-MarkLogic-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This XQuery code inserts the definition of the driver—her attributes and her preferences:<br />

let $from := cts:point(37.751658,-121.898387) (: San Ramon :)<br />

let $to := cts:point(37.507363, -122.247119) (: San Carlos :)<br />

return xdmp:document-insert( "/driver.xml",<br />

<br />

{$from}<br />

{$to}<br />

2010-01-20T08:00:00-08:00<br />

female<br />

no<br />

rock, pop, hip-hop<br />

10<br />

{<br />

cts:and-query((<br />

cts:element-value-query(<br />

xs:QName("gender"), "female"),<br />

cts:element-geospatial-query(xs:QName("from"),<br />

cts:circle(5, $from)),<br />

cts:element-geospatial-query(xs:QName("to"),<br />

cts:circle(5, $to))<br />

))<br />

}<br />

<br />

)<br />

85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!