August 2005 Archives

I've seen some people talking and some leaving comments that newly introduced XPathNavigator.SelectSingleNode() method is actually a wrapper around XPathNavigator.Select and so it provides no performance benefits. This is both true and false. It's true that you won't get any performance boost from moving to XPathNavigator.SelectSingleNode() method, because it's really just a wrapper around XPathNavigator.Select() returning first selected node. But that's also false that there is something wrong with it. No performance boost because XPathNavigator.Select() is efficient itself and never selects all nodes, returning instead XPathNodeIterator, which actually selects nodes once its MoveNext() method is called. So there is no perf difference, both are very fast and XPathNavigator.SelectSingleNode() method is mostly just about code elegance and convenience for a coder.

It's surprisingly tricky to get BinHex encoded data out of XmlDocument tree in .NET 1.X. XmlConvert class, which apparently has to support such conversions has a method FromBinHexString(), but weird - it only public for .NET Compact Framework. It's internal for regular .NET Framework. It's obvious that lots of .NET functionality isn't supported in .NET Compact Framework, but this is first time I see anything that .NET CF implements and .NET doesn't. Hmm, and in the forthcoming .NET 2.0 it's the same, do I miss something? Anyway, here is a workaround.

New new dragon book

| 2 Comments | No TrackBacks | ,

Great news for compiler geeks - new edition of the famous dragon book is to be published November 15. Updated and revised version, now it's called "21st Century Compilers". So far there were "old dragon book" (aka green dragon book, "Principles of Compiler Design", 1977) and "new dragon book" (red dragon book, "Compilers: Principles, Techniques and Tools", 1986). The color of the new new dragon book is still in question. Blue?

I guess what will be on the book cover?

topcoder.com

| 2 Comments | No TrackBacks |

I discovered TopCoder.com this weekend and now I know how I'm gonna spend my spare time next decade...

XML in SQL Server 2005 news

| No Comments | No TrackBacks | ,

Couple of news bits you want to check out if you are interested in XML and SQL Server 2005:

  1. Michael Rys talks about XML in the upcoming SQL Server 2005 on Channel9 43 min video.
  2. 15seconds.com published an article "SQL Server 2005 XQuery and XML-DML" by Alex Homer. Part 1, Part 2.

Jeni Tennison has announced an utility for unit-testing XSLT stylesheets:

I've just developed a set of stylesheets that are designed to support unit testing of XSLT stylesheets. You embed tests in the stylesheet and can run a script (or configure your editing environment) to extract and run them and create an HTML report on the result. Further details and the download is available from:

http://www.jenitennison.com/xslt/utilities/unit-testing/
XSLT 2.0 engine (Saxon 8.4B or later) is required.

Also she announced that her long-awaited "Beginning XSLT 2.0: From Novice to Professional" book is finally out:


Highly recommended for XSLT beginners.

Her is what James Gosling, Java's father said in a recent interview:

Direct language support for XML has been a debate for some time. All these things at an abstract level kind of sound like the thing to do.

When it comes down to the details, one of the problems ends up being that using Java today you actually get pretty good access to XML.

And really what it would end up being is sort of syntactic sugar that makes certain constructions simpler, but can you come up with something that actually makes people's life better by enough that it's worth adding that baggage?

It's one of these things that these days is a community debate.
That's pretty surprising. And even disappointing to some. I personally consider my Java XML programming experience as a horror. Well, then I was mostly writing XML processing apps in Java when DOM and SAX were the only ways and so whenever possible I escaped to XPath and XSLT. Now reading these James Gosling's words I'm happy I switched to .NET.

Michael Kay has released Saxon XSLT and XQuery processor v8.5. This new release implements some very interesting optimizations (available only in commercial version though) and new abilities, one of which is probably worth to implement in EXSLT.NET module.

Colin Paul Adams has announced Gobo Eiffel XSLT - free XSLT 2.0 processor written in Eiffel. Gexslt is intended to conform to a Basic-level XSLT 2.0 Processor and currently is still under development. Win32 compiled version can be downloaded at http://www.gobosoft.com/download/gobo34.zip.

XML Enhances Java

| 3 Comments | 3 TrackBacks |

If you thought it's only Microsoft who's working on integrating XML into the core of programming languages, look at what IBM does for Java. This is a manstream trend now. XML Enhancements for Java are an emerging technology from IBM, which provides a set of language extensions that facilitate XML processing in Java.

This is a real hidden gem in .NET 2.0 everybody (including me) have pretty much overlooked. XmlSchemaValidator class from the System.Xml.Schema namespace is a push-based W3C XML Schema validatation engine. Push-based means different processing model - an opposite for pull-based one. Think about how you work with XmlWriter (push) and XmlReader (pull). With (obsolete now) .NET 1.X's XmlValidatingReader and .NET 2.0's XmlReader with validation enabled you read XML to make sure it's valid. With XmlSchemaValidator you do the opposite - you ask it to validate XML bits using ValidateElement, ValidateAttribute, ValidateText etc methods.