You could use xdmp:http-get() to fetch the document (which will give you an http status code), use xdmp:unquote() to convert to xml (you can specify repair options here), then call xdmp:document-insert().
From: [email protected] [mailto:[email protected]] On Behalf Of Tim Meagher Sent: Friday, May 14, 2010 10:35 AM To: 'General Mark Logic Developer Discussion' Subject: [MarkLogic Dev General] Is there a simple way to retrieve http response statuses wen invoking xdmp:document-load? xdmp:document-load() is a very powerful function for copying documents and is superior to xdmp:document-insert() because: 1. It allows for document repair, and 2. You can copy a document without having to buffer it and then insert it. However, as far as I can tell there is no simple way to determine the success of the document retrieval by checking the http response status code without looking at the contents of the inserted document. Is that right? Is there some kind of debug status that can be enabled for document loads to determine the success of the http response code? If not, may I suggest that a simple mechanism be made available for doing so? It would be nice to know if the http source server is working properly, whether it is up or overloaded or whether the user is just pinging the wrong document URI. Thank you! Tim Meagher
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
