|
Posted by Hugo Kornelis on 11/01/07 22:28
On Thu, 1 Nov 2007 05:40:36 -0000, Tony Rogerson wrote:
>> Nah, I think text() + FOR XML certainly has the flavour of a kludge over
>> it. The syntax is anything about intuitive, and if the data include
>> ampersands or angle brackets, there are a few surprising waiting for us.
>
>I disagree, true - it's unintuitive to relational folk but isn't most XML.
>
>This the XML side of the SQL Server data engine and until you start learning
>how it works, syntax etc... then I guess anything to do with XML is a
>kludge.
>
>The ampersand and angle brackets are not suprises, books online tells us
>what the behaviour is, ampersand and square brackets both have meaning
>within the XML which is what text() is giving us.
Hi Tony,
Whether intuitive or not, it still is a kludge in my eyes. The phrase
FOR XML does somewhat imply that it is intended to produce, well, XML,
don't you think? And if you use that to produce straight-text non-XML
output, then I have no other word for it than "kludge".
Though I also agree with Erland that it's better than any of the
alternatives :)
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Navigation:
[Reply to this message]
|