jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: Xpath example to replace basicsearch
Date Wed, 29 Nov 2006 10:23:25 GMT
Darren Hartford schrieb:
> If basicsearch is not working, can someone help with an example of what
> an equivalent xpath query would be?
> 
> Old DASL basicsearch query:
> 
> String queryssn = "<D:searchrequest xmlns:D=\"DAV:\">" +
> "  <D:basicsearch xmlns:F=\"FAX\">" +   
> "<D:select>" +
> "<D:allprop/>" +
> "</D:select>" +
> "<D:from>" +
> "           <D:scope>" +
> "              <D:href>/slide/files/</D:href>" +
> "               <D:depth>infinity</D:depth>" +
> "           </D:scope>" +
> "       </D:from>" +
> "       <D:where>" +
> "           <D:eq>" +
> "               <D:prop><F:ORIGINNUMBER/></D:prop>" +
> "               <D:literal>555-555-5555</D:literal>" +
> "           </D:eq>" +
> "       </D:where>" +
> "   </D:basicsearch>" +
> "</D:searchrequest>";
> 
> Looking at the SearchInfo class, below is the basic example -- but I
> don't know how to convert the above to an equivalent:
> 
> String jackrabbitquery=
> "<d:searchrequest xmlns:d=\"DAV:\"
> dcr:=\"http://www.day.com/jcr/webdav/1.0\">" +
> "<dcr:xpath>//sv:node[@sv:name='myapp:paragraph']</dcr:xpath>" +
> "</d:searchrequest>";

I would expect it to be something like:

"/jcr:root/slide/files//*[@F:ORIGINNUMBER='555-555-5555']"

Note that this will produce different results if /slide/files matches 
the criterium; in DASL basicsearch it would be in scope, but it wouldn't 
for JCR Xpath (that's one of these nasty differences in semantics).

> ...

Best regards, Julian

Mime
View raw message