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.
August 2005 Archives
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.
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?
I discovered TopCoder.com this weekend and now I know how I'm gonna spend my spare time next decade...
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: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:
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.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.
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.