In Microsoft SQL Server 2008, when executing .query('{xpath}/text()')
on an XML stream column value, if the value of the XPath selected node contains "&
", the return value is "&
" instead of "&
".
Is this a bug, or am I doing something wrong? Or rather, how do I get the unencoded text, i.e. equivalent of .innerText (per W3C XML DOM), with SQLXML XPath if text() in the XPath query isn't supposed to do that?