admin:appserver-add-namespace( $config as element(configuration), $appserver-id as xs:unsignedLong, $namespaces as element(gr:namespace)* ) as element(configuration)
Add one or more namespaces to an App Server configuration, which will predefine the namespace(s) for all requests evaluated against the App Server.
http://marklogic.com/xdmp/privileges/admin/app-server
http://marklogic.com/xdmp/privileges/admin/app-server/{id}
http://marklogic.com/xdmp/privileges/admin/group
http://marklogic.com/xdmp/privileges/admin/group/{id}
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() return admin:appserver-add-namespace($config, admin:appserver-get-id($config,(), "Docs"), <namespace xmlns="http://marklogic.com/xdmp/group"> <prefix>myprefix</prefix> <namespace-uri>http://myuri/forthisprefix</namespace-uri> </namespace>) => The XML for new configuration with this namespace added. Use this as the argument to admin:save-configuration to change the configuration.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.