[MarkLogic Dev General] xdmp:document-load - possible bug?
jac at kb.dk
Mon Aug 16 07:40:42 PDT 2010
Isn't document-load() almost equal to document-get() + document-insert(), only with the handy feature of document repairing?
What I specify in the $location parameter is equal to document-get(), and what I have in the option $uri is equal to first parameter of document-insert() ?
Please correct me if I got things wrong.
Anyway, if a webserver answers 404, it means that there is no content. The HTML page saying "no page" is not the content.
Fra: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] På vegne af Justin Makeig
Sendt: 16. august 2010 15:28
Til: General Mark Logic Developer Discussion
Emne: Re: [MarkLogic Dev General] xdmp:document-load - possible bug?
I think you're confusing xdmp:document-load with xdmp:document-get. The first parameter of document-load <http://developer.marklogic.com/pubs/4.1/apidocs/UpdateBuiltins.html#xdmp:document-load> is the document's unique identifier once it's successfully inserted into a database. This URI can be anything you want, as long as it's unique. document-load is the complement to fn:doc <http://developer.marklogic.com/pubs/4.1/apidocs/SequenceBuiltins.html#fn:doc>, which allows you to retrieve a document from a database using its unique ID. The first parameter of document-get <http://developer.marklogic.com/pubs/4.1/apidocs/Ext-7.html#xdmp:document-get>, on the other hand, is the location of the document to be retrieved outside of a MarkLogic database. You can use HTTP or filesystem locations. It returns either the document itself, or as Nuno has illustrated, a serialized HTTP response.
Senior Product Manager
Phone +1 650 655 2387
email justin.makeig at marklogic.com<mailto:justin.makeig at marklogic.com>
This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.
On Aug 16, 2010, at 5:21 AM, Jacob Larsen wrote:
I would appreciate your opinion on this, before I report it as a bug.
I load an xml files using something like:
When http://some-apache-server/some-xml-file does not exist, apache reply "404 - Not Found" but also a simple HTML version of the error.
Mark Logic then creates a valid xml file from the HTML output, without checking the status code, and loads it.
I my view, this is clearly a bug. Every http GET request, should read the status code, and anything but 20* should result in some error from MarkLogic .
Any thoughts on this?
Civil Ingeniør | Software Engineer
Det Kongelige Bibliotek | The Royal Library
Digital Infrastruktur og Services | Digital Infrastructure and Services
tel +45 3347 4527 | jac at kb.dk
General mailing list
General at developer.marklogic.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General