Friday, February 24, 2012

Can I trust Microsoft for FOR XML AUTO or FOR XML RAW ?

Hi,
I have been there a situation of an apprehension that Microsoft may issue
some patch or hotfix in future for SQL SERVER, that will change the shape of
XML results yielded by FOR XML AUTO or FOR XML RAW query.
Our query is going to be rigid in the application and the data would then be
passed through sensitive application that may crash if xml is not valid, we
have many types of xmls so we cannot create schema for each and every guy an
d
same with EXPLICIT.
Is this superstition valid that I shouldnt trust Microsoft here ?
Any input in this will sincerely be appreciated.
Fahad"Fahad Ashfaque" <FahadAshfaque@.discussions.microsoft.com> wrote in message
news:86415A5A-428D-48DF-9175-114E9E0030F7@.microsoft.com...
> Hi,
> I have been there a situation of an apprehension that Microsoft may issue
> some patch or hotfix in future for SQL SERVER, that will change the shape
> of
> XML results yielded by FOR XML AUTO or FOR XML RAW query.
FOR XML AUTO and FOR XML RAW results are pretty well defined, since SQL
2000. It's doubtful these would change in the current version of SQL Server
(2005) or espcially in 2000. A lot of people have already written
applications that use this functionality which would surely break if they
changed it. However the results are subject to change if your schema
changes which is probably a much more likely situation.

> Our query is going to be rigid in the application and the data would then
> be
> passed through sensitive application that may crash if xml is not valid,
> we
> have many types of xmls so we cannot create schema for each and every guy
> and
> same with EXPLICIT.
I would recommend using FOR XML PATH if you have SQL 2005. It's easy to
use, uses XPath notation to define your XML, and you can easily update or
modify it if your schema changes.

> Is this superstition valid that I shouldnt trust Microsoft here ?
Like I said, if they change this in a Service Pack (and it's been around
since SQL 2000), they are going to have a lot of unhappy customers who have
invested a lot of time and money in building applications to use it. OTOH,
one could say the same thing about COM and VB 6 :) At any rate I wouldn't
worry too much about it until at least the next major version release.|||"Fahad Ashfaque" <FahadAshfaque@.discussions.microsoft.com> wrote in message
news:86415A5A-428D-48DF-9175-114E9E0030F7@.microsoft.com...
> Hi,
> I have been there a situation of an apprehension that Microsoft may issue
> some patch or hotfix in future for SQL SERVER, that will change the shape
> of
> XML results yielded by FOR XML AUTO or FOR XML RAW query.
>
> Our query is going to be rigid in the application and the data would then
> be
> passed through sensitive application that may crash if xml is not valid,
> we
> have many types of xmls so we cannot create schema for each and every guy
> and
> same with EXPLICIT.
> Is this superstition valid that I shouldnt trust Microsoft here ?
>
> Any input in this will sincerely be appreciated.
>
> Fahad
>
I know Microsoft occasionally make breaking changes but normally they go the
other way, everything has to be backwards compatible even to the detriment
of the latest version.
Have you any specific reason for worrying that the FOR XML statements are
going to be modified?
Joe Fawcett (MVP - XML)
http://joe.fawcett.name|||This seems like a strange thing to worry about. Aside from the basic issue
of how else would you represent a simple result set as XML, what motivation
would there be to ever changing this? What would happen if Microsoft did
this? There would be thousands of blog entries, newsgroup postings, and
news articles vilifying Microsoft for sticking it to the little guy, the
stock would drop, hundreds of employees would have to change their
retirement plans, and the SQL team would be hated by the rest of Microsoft.
Contrast this with the alternative of not changing code that works well
already and it makes changing the format a poor alternative.
Reading between the lines of your post makes me worry that you plan to do
some kind of roll your own text parsing instead of using a real XML parser.
If this is true then there could be an issue. While the results will be
semantically the same, it's hard to guarantee character for character
compatibility forever. If you want to do your own parsing you are better
off using something like comma separated values.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Fahad Ashfaque" <FahadAshfaque@.discussions.microsoft.com> wrote in message
news:86415A5A-428D-48DF-9175-114E9E0030F7@.microsoft.com...
> Hi,
> I have been there a situation of an apprehension that Microsoft may issue
> some patch or hotfix in future for SQL SERVER, that will change the shape
> of
> XML results yielded by FOR XML AUTO or FOR XML RAW query.
>
> Our query is going to be rigid in the application and the data would then
> be
> passed through sensitive application that may crash if xml is not valid,
> we
> have many types of xmls so we cannot create schema for each and every guy
> and
> same with EXPLICIT.
> Is this superstition valid that I shouldnt trust Microsoft here ?
>
> Any input in this will sincerely be appreciated.
>
> Fahad
>|||"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:OpxtSS7RHHA.4832@.TK2MSFTNGP03.phx.gbl...
> Reading between the lines of your post makes me worry that you plan to do
> some kind of roll your own text parsing instead of using a real XML
> parser. If this is true then there could be an issue. While the results
> will be semantically the same, it's hard to guarantee character for
> character compatibility forever. If you want to do your own parsing you
> are better off using something like comma separated values.
Do you see this being a problem if the OP is using Unicode?|||Could you expand a bit on what you mean? I'm not sure how Unicode fits into
the question.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Mike C#" <xyz@.xyz.com> wrote in message
news:%238jjscTSHHA.5060@.TK2MSFTNGP06.phx.gbl...
> "Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
> news:OpxtSS7RHHA.4832@.TK2MSFTNGP03.phx.gbl...
> Do you see this being a problem if the OP is using Unicode?
>|||"Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
news:O8Ac8EUSHHA.3592@.TK2MSFTNGP06.phx.gbl...
> Could you expand a bit on what you mean? I'm not sure how Unicode fits
> into the question.
"While the results will be semantically the same, it's hard to guarantee
character for character compatibility forever."
I assumed you were talking about character sets, code pages, etc., in your
"character for character compatibility" statement. Did I misunderstand?|||No, I was talking about white space and namespace prefixes, etc. These are
the things that break when people write their own parsers instead of using a
full XML parser.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Mike C#" <xyz@.xyz.com> wrote in message
news:uvLHAwWSHHA.3948@.TK2MSFTNGP05.phx.gbl...
> "Roger Wolter[MSFT]" <rwolter@.online.microsoft.com> wrote in message
> news:O8Ac8EUSHHA.3592@.TK2MSFTNGP06.phx.gbl...
> "While the results will be semantically the same, it's hard to guarantee
> character for character compatibility forever."
> I assumed you were talking about character sets, code pages, etc., in your
> "character for character compatibility" statement. Did I misunderstand?
>|||As the program manager still responsible for FOR XML, we are not planning on
changing the XML infoset generated by FOR XML RAW, EXPLICIT or PATH (unless
we guard it by a backwards-compatibility flag and will document the changed
behaviour ahead of time).
Between SQL Server 2000 and 2005 we did a few changes, mostly along the
lines of entitization changes. We had one breaking change in how FOR XML
AUTO dealt with subqueries and views that caused some pain, but was actually
a bug fix in the design of FOR XML AUTO's heuristics.
So if you can be more specific of what changes you fear, I can give you a
more definitive answer.
Changes that may happen in the future include addition or removal or certain
namespace declarations, changing order of attributes. But we are not
planning on changing the resultshapes of the different modes.
Best regards
Michael
"Fahad Ashfaque" <FahadAshfaque@.discussions.microsoft.com> wrote in message
news:86415A5A-428D-48DF-9175-114E9E0030F7@.microsoft.com...
> Hi,
> I have been there a situation of an apprehension that Microsoft may issue
> some patch or hotfix in future for SQL SERVER, that will change the shape
> of
> XML results yielded by FOR XML AUTO or FOR XML RAW query.
>
> Our query is going to be rigid in the application and the data would then
> be
> passed through sensitive application that may crash if xml is not valid,
> we
> have many types of xmls so we cannot create schema for each and every guy
> and
> same with EXPLICIT.
> Is this superstition valid that I shouldnt trust Microsoft here ?
>
> Any input in this will sincerely be appreciated.
>
> Fahad
>|||Thankyou very much for your interest in helping me Michael and other guys to
o.
Well I am getting simple shaped XML from a single table which we then
transform using XSL. The changes which I am anticipating include
Adding any namespace to data element that will make our XPath expressions
useless. We will NEVER be able to update XPaths and issue new release of our
software once it is burnt into the hardware.
Changes in the source tree, again it will require us to update XSL.
"Michael Rys [MSFT]" wrote:

> As the program manager still responsible for FOR XML, we are not planning
on
> changing the XML infoset generated by FOR XML RAW, EXPLICIT or PATH (unles
s
> we guard it by a backwards-compatibility flag and will document the change
d
> behaviour ahead of time).
> Between SQL Server 2000 and 2005 we did a few changes, mostly along the
> lines of entitization changes. We had one breaking change in how FOR XML
> AUTO dealt with subqueries and views that caused some pain, but was actual
ly
> a bug fix in the design of FOR XML AUTO's heuristics.
> So if you can be more specific of what changes you fear, I can give you a
> more definitive answer.
> Changes that may happen in the future include addition or removal or certa
in
> namespace declarations, changing order of attributes. But we are not
> planning on changing the resultshapes of the different modes.
> Best regards
> Michael
> "Fahad Ashfaque" <FahadAshfaque@.discussions.microsoft.com> wrote in messag
e
> news:86415A5A-428D-48DF-9175-114E9E0030F7@.microsoft.com...
>
>

No comments:

Post a Comment