0
鉴于以下XQuery代码生成路径并基于MarkLogic数据库中的数据保存文件,如何在不存在的情况下创建文件系统文件夹没有得到例外?如何在保存文件时在文件系统上创建文件夹
for $doc in collection("http://example.com/stuff")
let $folderName := name($doc/Envelope/*[1])
let $folderPath := concat("c:\temp\", $folderName, "\")
let $fileName := concat($doc/Envelope/*[1]/*:Code/text(), ".xml")
let $fullPath := concat($folderPath, $fileName)
(: Create the folder at $folderPath if it does not exist :)
return xdmp:save($fullPath,$doc)