我正在python中使用xquery更新,并尝试从xml树中提取子元素,并将它们作为新的父元素插入DBXML数据库。在下面的xquery中,我尝试迭代每个子级,然后将子级插入父集合。你知道吗
for $child in collection($items)/parent/path/to/child return (
insert node $child into collection($items)
)
但是,会产生以下错误。你知道吗
XmlQueryEvaluationError Error: Cannot perform an update that creates a persistent document with more than one document element, line 0, column
我还尝试过插入具有可变值但定义了所有节点的xml。同样的错误也会产生。你知道吗
for $child in collection($items)/parent/path/to/child return (
insert node <parent><item>{$child/item}</item></parent> into collection($items)
)
我希望您不能使用XQuery更新集合。你知道吗
代替
fn:collection
作为update语句的上下文,您很可能需要提供单个文档节点或其他节点。你知道吗您的第一条语句实际上是在集合中的每个文档节点中插入一些
child
节点。你知道吗如果您只想使用XQuery插入一个新文档,我不确定在DBXML中是否可以这样做:http://docs.oracle.com/cd/E17276_01/html/intro_xml/modifyingdocuments.html
相关问题 更多 >
编程相关推荐