Loading TOC...

infodev:ingest

infodev:ingest(
   $document as node()?,
   $path as xs:string,
   $ticket-id as xs:string,
   [$policy-deltas as element(info:options)?],
   [$properties as element()*]
) as xs:string

Summary

[DEPRECATED] This function ingests a single document into the database specified in the ticket, according to the rules defined by the named policy and user-supplied options.

Parameters
document The node to be inserted.
path The name of the document and the URI path under which it is to be inserted in the database. In order for the path to be included in the URI, you must have <path/> in the uri portion of your policy:

      <options xmlns="http://marklogic.com/appservices/infostudio">
         <uri>
           <literal/>
           <path/>
           <filename/>
           <literal>.</literal>
           <ext/>
         </uri>
      </options> 
ticket-id The ID of the ticket created by the infodev:ticket-create function.
policy-deltas An options node to be used with requests associated with this ticket. It is merged with the effective policy at runtime.
properties Any properties you want to set on the document. This does the same thing as the xdmp:document-set-properties function.

Example

  xquery version "1.0-ml"; 

  import module namespace infodev = "http://marklogic.com/appservices/infostudio/dev"
      at "/MarkLogic/appservices/infostudio/infodev.xqy";
  
  let $document := xdmp:document-get("C:\mydocs\xmldocs\my.xml")
  let $path := "/newxml/my.xml"
  let $annotation := <info:annotation>Adding my.xml doc</info:annotation>
  let $ticket := infodev:ticket-create($annotation, "myDB", "default", ())

  let $deltas :=
  <options xmlns="http://marklogic.com/appservices/infostudio">
     <uri>
        <literal>http://testing</literal>
        <path/>
        <filename/>
        <literal>.</literal>
        <ext/>
     </uri>
  </options>
  
  return
     infodev:ingest($document, $path, $ticket. $deltas)

  (: loads the my.xml file, using the default policy, into the URI, 
     http://testing/newxml/my.xml. :)
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.