Limiting query results to a specified collection using xmlrpc

View: New views
2 Messages — Rating Filter:   Alert me  

Limiting query results to a specified collection using xmlrpc

by whitej8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I am attempting to use the xmlrpc API to connect to my eXist server.  Can anyone tell me how to limit my results to a single collection?

 

I’ve tried connecting to the server at http://localhost:8080/exist/xmlrpc/db/edc_test however this yields the same results as connecting to http://localhost:8080/exist/xmlrpc  and returns all matching records regardless of collection.

 

I have been able to successfully limit my results by writing xqueries like

 

for $x in collection("/db/edc_test")//root/element where $x/@name="two" return $x

 

but this is an extremely clunky format.  Is there a “clean” way to do this that would not require modifying all my existing xqueries?

 

Thanks for the help,

 

Jason White



This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).

------------------------------------------------------------------------------

_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Limiting query results to a specified collection using xmlrpc

by WolfgangM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I’ve tried connecting to the server at
> http://localhost:8080/exist/xmlrpc/db/edc_test however this yields the same
> results as connecting to http://localhost:8080/exist/xmlrpc  and returns all
> matching records regardless of collection.

Yes, that's the expected behaviour. Maybe you are confusing XMLRPC
with REST? The  XMLRPC service responds to exactly one URL, which is
http://localhost:8080/exist/xmlrpc. The rest of the path has no
relevance and is simply ignored by the XMLRPC library.

> I have been able to successfully limit my results by writing xqueries like
>
> for $x in collection("/db/edc_test")//root/element where $x/@name="two"
> return $x

Yes, that's the way to do it. You should consider using REST if you
want your query to depend on the context path. Normally it's not a
problem to mix REST and XMLRPC in the same app.

Wolfgang

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open