I have this xml on a table:
<BookData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DataVersion>
<Name>ABC</Name>
<Data xsi:type="xsd:string">DEF</Data>
</DataVersion>
</BookData>'
I want to modified the xml with this xquery:
UPDATE
LibraryOverride SET XMLConfig.modify(
'declare namespace ns="http://www.w3.org/2001/XMLSchema-instance";
'replace value of (//ns:BookData/DataVersion/Data)[1] with "TEST"')
Where
PropertyOverrideID = 1
I am getting this error:
XQuery [LibraryOverride.XMLConfig.modify()]: The target of 'replace value of' must be a non-metadata attribute or an element with simple typed content, found 'element(Data,xdt:untyped) ?'