April CTP has been released: What are the changes in the XML area
As many of you probably already have heard, we have publicly released the April Community Tech Preview (CTP) and have also announced that we are continuing with CTPs instead of doing a Beta3. I agree with Adam: This is good for getting both more and better feedback from our customers. And it allows us to be more flexible with providing fixes and new developments earlier to customers. You can get the normal SQL Server Developer Edition through the MSDN Subscription download and as always SQL Server Express (and VisualStudio 2005 Beta2) from the MSDN site directly.
Now let me continue the tradition to report on what has changed with this CTP over the previous (February) CTP in the area of XML:
Breaking Changes:
- Ownership chaining is enforced for XML Schema Collections.
- The names of many of the XML schema collection related catalog views have changed – see the change list for XML catalog views for details.
Basically, we have added _schema to the catalogs that do not yet have it as part of their name. For example, the sys.xml_components table is now called sys.xml_schema_components.
- Closer alignment with the W3C XQuery July 2004 working draft and other XQuery changes:
- The sequence type syntax and semantics (used in instance of) got aligned to a subset of the July 2004 WD: For example, we require instance of(<name>, <type> ?) instead of instance of(<name>, <type> nillable), and we do not take schema components for element names into account anymore.
- The functions get-local-name-from-QName() and get-namespace-uri-from-QName() have been renamed to local-name-from-QName() and namespace-uri-from-QName() respectively.
- XQuery comment delimiters (not constructors) are now (: and :) respectively instead of {-- and --}.
- The type xdt:untypedAny has been renamed to xdt:untyped.
- We now require a ‘;’ after each XQuery prolog entry. So please make sure that you are adding them now!
- Support for lt, gt, le, ge on Gregorian types has been removed.
- fn:concat now only supports 2 to n parameters as prescribed by the working draft (instead of 0 to n).
- End-of-line and whitespace normalization for attribute content and literal string values inside XQuery expressions in attribute content when being used in a direct element constructor have been aligned with the July WD.
- sum() on empty sequence returns now 0 instead of ().
- Grammar precedences of instance of, cast as and unary +/- have been aligned to July 2004 WD.
- We fixed the comparison semantics on xs:date: xs:date("2005-01-19+14:00") < xs:date("2005-01-18-14:00") will now return true.
- We aligned our static typing rules across the XQuery aggregators (min/max/sum/avg), the order by clause, and distinct-values(). The new rules now require that the expressions passed to these functions and the order by clause statically have a single primitive base type. The acceptable base types depend on the agregators. For example, sum() supports the 3 numeric base types or xdt:untypedAtomic (which will be treated in this case as xs:double), but you cannot have a static mixture of numeric types with different base types. Also, distinct-values() already since the February CTP performs atomization implicitly.
- FOR XML: You cannot generate an inline schema with target namespace http://www.w3.org/XML/1998/namespace anymore (well, you shouldn't have done that before anyway, but now we will error).
- Namespace URI values in XQuery, the XML datatype parser and FOR XML (but not OpenXML) will now get whitespace normalized according to the xs:anyURI rules. This means that leading and trailing whitespace gets removed and whitespace inside will be collapsed. Note: URIs should not contain whitespaces in the first place!
- The nodes() method result cannot be referenced anymore inside ORDER BY or GROUP BY without applying an XML datatype method.
Non-Breaking changes:
The next CTP will bring a few more XQuery function alignments and more performance improvements as well as some additional whitespace preservation measures. Stay tuned!