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標籤剝離出來。
任何想法?