Jacob, Yes, you’re correct. Sorry about the confusion; my coffee apparently has not kicked in. xdmp:document-load does allow you to load documents from HTTP directly into a database. (xdmp:document-insert, as you point out, takes a URI and a node(), independent of where the node came from). I’ve noted your request and we’ll take a look at other ways of handling error responses in xdmp:document-load as we plan subsequent releases. Thanks.
Justin On Aug 16, 2010, at 10:40 AM, Jacob Larsen wrote: > Hi Justin > > 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. > > Best > > /Jacob > > > > > > Fra: general-boun...@developer.marklogic.com > [mailto:general-boun...@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? > > Jacob, > 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. > > Justin > > > > Justin Makeig > Senior Product Manager > MarkLogic Corporation > > Phone +1 650 655 2387 > > email justin.mak...@marklogic.com > web www.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: > > > Hi All > > I would appreciate your opinion on this, before I report it as a bug. > > I load an xml files using something like: > xdmp:document.load(“http://some-apache-server/some-xml-file”) > <options xmlns="xdmp:document-load"> > <repair>full</repair> > </options>) > > 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? > > Best regards > > Jacob > > > ----------------------------------------- > Jacob Larsen > Civil Ingeniør | Software Engineer > > Det Kongelige Bibliotek | The Royal Library > Digital Infrastruktur og Services | Digital Infrastructure and Services > tel +45 3347 4527 | j...@kb.dk > > _______________________________________________ > General mailing list > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general > > _______________________________________________ > General mailing list > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general