How can I set the output format of "FOR XML"?
-
At the moment I have a query that returns data about meetings in XML format using the "FOR XML AUTO, ELEMENTS" clause The problem is that if there is a meeting with the same person on the same day (I know, its hardly a common occurance) the XML output comes out like this:
<mdate> <![CDATA[02/06/2006]]> </mdate> <Meetings> <id> <![CDATA[92]]> </id> <complete> <![CDATA[1]]> </complete> </Meetings> <Meetings> <id> <![CDATA[93]]> </id> <complete> <![CDATA[2]]> </complete> </Meetings>
Unfortunatley because of the XSL file doing the formating it does not make table entries for the second meeting (id:93 in this example). What I want idealy is for the XML output to contain all the meeting information in seperate entries ... and NOT cluster together meetings with the same people one the same date like it is doing. Any ideas? or should i make a different XSL file to handle this out put? (and if so any hints on doing that as I mostly just loop through output in a very simple manner) Thanks -
At the moment I have a query that returns data about meetings in XML format using the "FOR XML AUTO, ELEMENTS" clause The problem is that if there is a meeting with the same person on the same day (I know, its hardly a common occurance) the XML output comes out like this:
<mdate> <![CDATA[02/06/2006]]> </mdate> <Meetings> <id> <![CDATA[92]]> </id> <complete> <![CDATA[1]]> </complete> </Meetings> <Meetings> <id> <![CDATA[93]]> </id> <complete> <![CDATA[2]]> </complete> </Meetings>
Unfortunatley because of the XSL file doing the formating it does not make table entries for the second meeting (id:93 in this example). What I want idealy is for the XML output to contain all the meeting information in seperate entries ... and NOT cluster together meetings with the same people one the same date like it is doing. Any ideas? or should i make a different XSL file to handle this out put? (and if so any hints on doing that as I mostly just loop through output in a very simple manner) ThanksHi If you are using .Net then you can create XSD file for that and then you can store the output in dataset created by XSD. Regards
Tushar kothari