I'm trying to do a simple 'replace value of' for an element in an XML
column whose XSD looks like:
[snip]
<xs:element name="body" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="1" maxOccurs="unbounded"
processContents="skip"/>
</xs:sequence>
</xs:complexType>
</xs:element>
[snip]
I've tried using various syntaxes:
xmlEmail.modify('replace value of (/email/body/text())[1] with "<p>Task
has been assigned</p>"')
gives:
XQuery [@tblTasks.xmlEmail.modify()]: Result of 'text()' expression is
statically 'empty' (SQL error = 2377)
xmlEmail.modify('replace value of (/email/body)[1] with
xs:string("<p>Task has been assigned</p>")')
gives:
XQuery [@tblTasks.xmlEmail.modify()]: The target of 'replace value of'
must be a non-metadata attribute or an element with simple typed
content, found 'element(body,#anonymous) ?' (SQL error = 2356)
Does anyone know how to update this element?
>> Stay informed about: Update xs:any element