Xquery 将输出从exist db打印到文件
我已经在exist数据库上执行了一个xquery。现在,我想将输出打印到csv或excel文件之类的文件中,这是如何实现的Xquery 将输出从exist db打印到文件,xquery,exist-db,Xquery,Exist Db,我已经在exist数据库上执行了一个xquery。现在,我想将输出打印到csv或excel文件之类的文件中,这是如何实现的 我可以以HTML格式打印输出,但是否有办法生成相同的文件。使用FileModule,它具有序列化功能: file:serialize file:serialize($node-set as node()*, $path as item(), $parameters as xs:string*, $append as xs:boolean) as xs:boolean?
我可以以HTML格式打印输出,但是否有办法生成相同的文件。使用FileModule,它具有
序列化功能:
file:serialize
file:serialize($node-set as node()*, $path as item(), $parameters as xs:string*,
$append as xs:boolean) as xs:boolean?
Writes the node set into a file on the file system, optionally appending to it. $parameters contains a sequence of zero or more serialization parameters specified as key=value pairs. The serialization options are the same as those recognized by "declare option exist:serialize". The function does NOT automatically inherit the serialization options of the XQuery it is called from. This method is only available to the DBA role.
Parameters:
$node-set* The contents to write to the file system.
$path The full path or URI to the file
$parameters* The serialization parameters specified as key-value pairs
$append Should content be appended?
Returns:
xs:boolean? : true on success - false if the specified file can not be created or is not writable. The empty sequence is returned if the argument sequence is empty.
文件:序列化
文件:序列化($node设置为node()*,$path设置为item(),$parameters设置为xs:string*,
$append as xs:boolean)作为xs:boolean?
将节点集写入文件系统上的文件,可以选择附加到该文件$参数包含指定为键=值对的零个或多个序列化参数序列。序列化选项与“declare option exist:serialize”识别的选项相同。该函数不会自动继承调用它的XQuery的序列化选项。此方法仅对DBA角色可用。
参数:
$node set*要写入文件系统的内容。
$path文件的完整路径或URI
$parameters*指定为键值对的序列化参数
$append是否应追加内容?
返回:
xs:boolean?:成功时为true-如果指定的文件无法创建或不可写,则为false。如果参数序列为空,则返回空序列。
参考资料
我猜可以使用exist db中的文件模块来完成,但我找不到任何使用该模块的文档。