Hi, Vikas: I should have read this note before the other question.
As a result of bug fix, recent versions of MarkLogic 7 take advantage of the document extension and the mime type mapping table to determine the format of document. In MarkLogic 6 and 7, if you write a JSON document with the .json extension, MarkLogic will do the transformation to and from XML for you on the way in and out. We recommend using the .json extension because, though stored as XML, these documents look like JSON documents externally. In MarkLogic 8, JSON documents will be stored natively, eliminating the need for the built-in transform. By assigning the .json extension now, you will be able to preserve stable document identity when upgrading to MarkLogic 8. Hoping that helps, Erik Hennum ________________________________ From: general-boun...@developer.marklogic.com [general-boun...@developer.marklogic.com] on behalf of Geert Josten [geert.jos...@marklogic.com] Sent: Tuesday, February 03, 2015 3:57 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] document rest api with json transformation Hi Vikas, Sounds like the right approach to me. I am not aware of significant changes in this area between ML6 and ML7. Are you sure you are sending the request body with the right header ‘Content-type’? And could you share the transform, or the essential part of it? Kind regards, Geert From: "vikas.sin...@cognizant.com<mailto:vikas.sin...@cognizant.com>" <vikas.sin...@cognizant.com<mailto:vikas.sin...@cognizant.com>> Reply-To: MarkLogic Developer Discussion <general@developer.marklogic.com<mailto:general@developer.marklogic.com>> Date: Tuesday, February 3, 2015 at 10:21 AM To: "general@developer.marklogic.com<mailto:general@developer.marklogic.com>" <general@developer.marklogic.com<mailto:general@developer.marklogic.com>> Subject: [MarkLogic Dev General] document rest api with json transformation Hi All, We are using document and transform rest api together , we just upgraded our system to Marklogic 7 till Marklogic 6 it was working fine. Request url : http://ip:9000/v1/documents?uri=/content_assessments/assessments/abc40148ef3c41399187eefed939a9d5.xml&collection=Assessments&transform=assessment Content type :application/json Uri of document is ends with .xml We are passing content as json documents with put request . If we are passing uri ends with “.xml” and content as “json” in Marklogic7 , we are getting error xdmp:DOCROOTTEXT since it is failing documents rest api. We can change the transformation code since in MarkLogic 7 changed the definition of function but we do not want to change the uri which ends with .xml extension. How can we achieve this without changing the uri we want to convert json to xml and save ? Regards, Vikas Singh This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general