В SQL Server 2014 я пытаюсь добавить элемент XML с атрибутом (который содержит возврат каретки), используя метод «изменить» для типа данных XML. Возврат каретки удаляется - почему?
Пример:
declare @xmldata xml
select
@xmldata = '<root><child myattr="carriage returns 
 are not a problem"></child></root>'
set
@xmldata.modify('insert <child>modifying text with carriage returns works
ok</child> after (//child)[1]')
set
@xmldata.modify('insert <child myattr="but not
attribute values... why is that?"></child> after (//child)[2]')
select @xmldata
Результат:
<root>
<child myattr="carriage returns 
 are not a problem" />
<child>modifying text with carriage returns works
ok</child>
<child myattr="but not attribute values... why is that?" />
</root>