All Forums Extensibility
TDDeveloper 17 posts Joined 09/09
15 Aug 2012
SYSXML.XMLELEMENT FUNCTION

I am adding an element of string content using the above function.  What I was hoping is that the string content to be cleaned or converted to entities of characters that are not otherwise valid within XML document.  But this is not happening. Any suggestions please?

SELECT sysxml.xmlelement('dept','','',departmentname) x
FROM ep.department
WHERE (departmentname LIKE ANY ( '%&%','%#%'))

Result: <dept>M&S Food</dept>

Expected:  <dept>M&amp;S Food</dept>

Thanks 

 

 

You must sign in to leave a comment.