sponsored links

Collapse

Announcement

Collapse
No announcement yet.

XMLATTRIBUTE Function New Line Character

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • XMLATTRIBUTE Function New Line Character

    I am trying to create an XML using the SQL XML functions. One of the things that I need to do is add newlines to an attribute value. The special character sequence for new line is " ". When I run that through the XMLATTRIBUTE function it comes out as 
 because the & is a special character and gets replaced. Is there a way to get the & to not be replace? Or is there a special sequence of characters that get translated to " "?

    Example:
    xmlserialize(XMLELEMENT(NAME "test", XMLATTRIBUTEs('abc xyz' as "test1")) as varchar(1000))

    Output:
    <test test1="abc &amp;#10; xyz"/>
Working...
X