es:with-namespace( $instance as map:map, $namespace as xs:string, $namespace-prefix as xs:string ) as map:map
This function is deprecated and will not be supported in MarkLogic 11.
A utility function used to decorate an XML instance with namespace
information during extraction.
xquery version "1.0-ml"; import module namespace es = "http://marklogic.com/entity-services" at "/MarkLogic/entity-services/entity-services.xqy"; let $raw := fn:doc('/es-gs/raw/1234.xml') let $instance := es:init-instance(es:init-source($raw, 'Person'), 'Person') return es:with-namespace($instance, 'http://marklogic.com/entity-services/getting-started','esgs') (: Returns an initialized instance similar to the following: : { "$type":"Person", : "$namespace":"http://marklogic.com/entity-services/getting-started", : "$namespacePrefix":"esgs" : } :)