0
我在XML格式的Excel工作表中包含XQuery的FN:更换不表现为预期
<Cell ss:StyleID="s127"><Data ss:Type="String">Replace Me</Data></Cell>
我想替换使用不同的字符串@ A01-更换。我正在使用XQuery的替换函数,如下所示:
let $excel := doc("document.xml")
let $test := "another string"
return replace($excel, "Replace Me", $test)
在调用replace之前,变量$ excel在输出时是有效的XML。但是,当我调用replace函数后输出$ excel时,所有的XML标签都被剥离了,$ excel是一个字串,其内容是单元格的值。我想保留那里的XML标签。
我期望是
<Cell ss:StyleID="s127"><Data ss:Type="String">another string</Data></Cell>
不过,我得到
another string
所有的XML标签剥离出来。
任何想法?