0
我需要以特定的格式XML返回成單獨的節點元素
<Applicants xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Applicant>
<Name>John Smith</Name>
<Address>1 Smiths Close</Address>
</Applicant>
<Applicant>
<Name>Peter Smith</Name>
<Address>2 Smiths Close</Address>
</Applicant>
</Applicants>
返回的結果,但我目前的查詢
select A.Name
, ANL.name
, A.address AS Address
, ANL.address AS Address
from Agents A
left join AgentsNonLatin ANL
On A.Pn = ANL.Pn AND A.Kd = ANL.kd
FOR XML RAW('Applicant'), ROOT('Applicants'), ELEMENTS XSINIL
我讓他們合併成一個單一<Applicant>
節點。
<Applicants xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Applicant>
<Name>John Smith</Name>
<Name>Peter Smith</Name>
<Address>1 Smiths Close</Address>
<Address>2 Smiths Close</Address>
</Applicant>
</Applicants>
有關需要更改哪些內容以便以所需格式返回的任何想法?