Hi all,
In sql server 2005, I'm just getting my feet wet with the FOR XML clause.
When I use For Xml Auto, what it seems to do is create a bunch of elements using the table name as the element name (an element for each row returned), and then instead of sub-child elements for each field, it instead makes each field an attribute of the only element level.
So my question is: would it not be more 'typical' to have the row as an element, then each field as a child element to the row?
The end game here is that I just want to simplify outputting data to the web, via asp pages. I've been able to use the adodb.stream object and can get the raw xml output, and now I want to use an xsl sheet with it, and it seems more natural to have each field as a child element. I think I can make it work as-is, but I'm just wondering if there's ways to tweak the For XML clause to adjust how it outputs the stream.
Thanks,
--Jim
In sql server 2005, I'm just getting my feet wet with the FOR XML clause.
When I use For Xml Auto, what it seems to do is create a bunch of elements using the table name as the element name (an element for each row returned), and then instead of sub-child elements for each field, it instead makes each field an attribute of the only element level.
So my question is: would it not be more 'typical' to have the row as an element, then each field as a child element to the row?
The end game here is that I just want to simplify outputting data to the web, via asp pages. I've been able to use the adodb.stream object and can get the raw xml output, and now I want to use an xsl sheet with it, and it seems more natural to have each field as a child element. I think I can make it work as-is, but I'm just wondering if there's ways to tweak the For XML clause to adjust how it outputs the stream.
Thanks,
--Jim