Hi All

I am using document rest api put method  as below with transformation code  in 
marklogic7.

Request url: 
http://ip:9000/v1/documents?uri=/content_assessments/assessments/abc40148ef3c41399187eefed939a9d555ss1.json&collection=Assessments&transform=assessment
Content-type: "application/json"

In transformation rest api I am converting this document to xml
declare function assessment:transform($context as map:map, $params as map:map, 
$content as document-node())as document-node()
{
  let $document := 
json:transform-from-json(json:transform-to-json-object($content), 
json:config("full"))
  let $output-types := map:put($context,"output-type", "application/xml")
  let $fileuri := map:put($context,"uri", 
fn:concat(fn:substring-before(map:get($context,"uri"), ".json"), ".xml"))
  return document {$document)
};

I want to change the uri location to save xml file as well as "output-type" but 
finding issue in marklogic7.

In code I am modifying $context map to modify uri as well as "output-type" .How 
can I achieve this in Marklogc7?


Regards,
Vikas
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
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to