Note that xdmp:http-get() supports repair options too - but they have to 
be specified in the right namespace.

http://developer.marklogic.com/pubs/4.1/apidocs/Ext-2.html#xdmp:http-get
>
> This parameter can also include certain option elements (for example,
> repair, encoding, default-language) in the xdmp:document-load and
> xdmp:document-get namespaces.

xdmp:http-get(
   'http://google.com/DNE',
   <options xmlns="xdmp:http-get">
     <format xmlns="xdmp:document-get">xml</format>
     <repair xmlns="xdmp:document-get">full</repair>
   </options>)

You can also use xdmp:tidy() on the response. That technique can 
sometimes fix up html that is too far gone for repair=full to handle. 
You might even decide which options to use on a case-by-case basis.

-- Mike

On 2010-05-14 08:12, Mark Helmstetter wrote:
> 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

Reply via email to