Hi,
I need to execute XQuery from a REST client app and retrieve results
as XML documents. I made a similar thing easily using exit-db back-end
but I'm somehow stuck to find the best practice with ML 7 to code the
same thing.
The pseudo-code (Python like) I made looks like this :
-----------
# Instanciate the client / server proxy
client = XQueryBackEnd(location_params, auth_token)
# Execute the query, and retrieve a results set reference
results_set = client.execute_xquery(some_xquery_script)
# Have error?
if results_set.error_message is not empty:
exit()
end if
# How many results some_xquery_script yields
results_count = results_set.count
# Iterating through the XML results
for index in range(results_count): # O, 1, ..., results_count - 1
# Retrieve each individual result
xml_result = results_set.get_item(index)
# Make app stuffs with each individual result
play_with(xml_result)
end for
----------
Any pointer that could help me to do the same thing the best way is
welcome. My only constraints are :
- I cannot use the Java API, only REST!
- I don't want to retrieve all results in the memory of the
results_set object since there may be thousands of big XML objects.
- The XQuery expressions are built/stored in the client app and NOT
pre-stored in the ML server.
Many thanks by advance
--
Gilles Lenfant
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general