I have an Excel worksheet in XML format which contains
<Cell ss:StyleID="s127"><Data ss:Type="String">Replace Me</Data></Cell>
I want to replace @A01-Replace with a different string. I'm using the XQuery's replace function like so:
let $excel := doc("document.xml")
let $test := "another string"
return replace($excel, "Replace Me", $test)
Before calling replace, the variable $excel is valid XML upon output. However, when I output $excel after I call the replace function, all of the XML tags have been stripped, and $excel is a string with the content of the cells as its values. I would like to keep the XML tags there.
What I expect is
<Cell ss:StyleID="s127"><Data ss:Type="String">another string</Data></Cell>
However, I get
another string
All the XML tags are stripped out.
Any ideas?