How To Use Comma In Xml
The first step is to wrap the comma delimited data with root root xml tags so it can be treated as an xml document.
How to use comma in xml. I am having some difficulties understanding how to use comma in format number in xml. Name1 1 developer name2 2 lead name3 3 manager need help in approcah to trnasorm to the required format. Can someone explain it to me please. Clearly i am understanding it wrong. Appreciate your help on this.
But the query method returns the data of xml type which will hinder to do so henceforth first we need to convert the xml data type to varchar and then we can use the replace function. For example xsl value of select format number 123456 gives me 12 34 56 but from what i read the comma is a group separator so i thought it should have been 1234 56. Source sends the data in below format because of constraint on their system. The above query returns a space separated list with the values stored in the xml fragment to fulfill our objective we can use replace function to replace the spaces with comma s. To include special characters inside xml files you must use the numeric character reference instead of that character.
Name1 name2 name3 1 2 3 developer lead manager need to convert to below format. I ll use the cross apply method since that is easiest imo to read. The numeric character reference must be utf 8 because the supported encoding for xml files is defined in the prolog as encoding utf 8 and should not be changed.