Michael Rys

Musings on XML, XQuery and more...

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Papers

SQL Server XML Whitepapers

Weblogging Links

MS Bloggers

Recommended Books

Other Blogs

Recommended Links

Presentations (Upcoming)

Presentations (Recent)

Subscriptions

News


Upcoming Presentations


TechEd 2007, Orlando, June 4 to June 8, 2007


Books I co-authored



www.flickr.com
This is a Flickr badge showing public photos from Michael Rys. Make your own badge here.
eXTReMe Tracker

Post Categories

Article Categories



SQL Server 2005 CTP XML functionality enhancement (also known as the SQL Server XML Christmas presents)

As I mentioned earlier, we are working on adding some requested features to Beta3. The December CTP build (981.04) already contains one of them.

Per default, if you parse an XML instance, we drop some whitespace characters unless they are guarded with an xml:space="preserve" attribute or are entitized.

For example,

select CONVERT(XML, '<a>   </a>')
will return

<a/>

which means that the whitespace only content has been dropped. Note that this is not 100% XML 1.0 spec conformant but conforms to the 95% user expectation.

So,

select CONVERT(XML, '<a xml:space="preserve">   </a>')
will return

<a xml:space="preserve">   </a>

and
select CONVERT(XML, '<a>&#x20;&#x20;&#x20;</a>')
will return

<a>   </a>

which preserves the whitespace.

However, often users cannot change their data to protect the whitespace. Therefore we have added a new convert option that will preserve the whitespace regardless. So it is my pleasure to introduce:

select CONVERT(XML, '<a>   </a>', 1)

which returns

<a>   </a>

Some additional things we are working on for the next CTP and Beta3 are (standard disclaimer is that this may or may not be included according to last minute decisions):

  1. Performance, performance and (you guessed it) performance.
  2. Disabling DTD and entity declaration processing during parsing by default. This is a security item to minimize the danger of “entity expansion“ overload. You will still be able to get the DTD functionality with a CONVERT style option.
  3. Further alignment of the implemented XQuery functionality to the July 2004 WD stage. This will be most likely the state with which we will ship RTM. So if you have any issues, please let us know (and start adding those semi-colons after the namespace declarations now! :-)).
  4. Adding namespace support to FOR XML PATH.
  5. Restricting datetime, time and date values to values with timezones and serialize them with Z (this is the result of the recent customer survey). Enabling value() method returning a Z-normalized value to datetime. 

Merry Christmas, hohoho :-)

posted on Friday, December 17, 2004 1:32 PM by mrys


# SQL Server 2005 CTP XML functionality enhancement (also known as the SQL Server XML Christmas presents) @ Friday, December 17, 2004 5:20 PM

mrys




Powered by Dot Net Junkies, by Telligent Systems