August 31, 2004

The oldest blog - Edsger W. Dijkstra's manuscripts

Like most of us, Dijkstra always believed it a scientist's duty to maintain a lively correspondence with his scientific colleagues. To a greater extent than most of us, he put that conviction into practice. For over four decades, he mailed copies of his consecutively numbered technical notes, trip reports, insightful ...

August 30, 2004

XQuery book sample chapter

By the way, Chapter 3 "Navigation" of the "XQuery: The XML query language" book by Michael Brundage is available online on Michael's site (PDF version). Take a look at http://www.qbrundage.com/xquery/toc.html. ...

Yasser Shohoud's "Real World XML Web Services" book online

Yasser Shohoud's great "Real World XML Web Services" book is available online at http://www.learnxmlws.com/book. [Via Yasser himself.] ...

August 29, 2004

Kurt Cagle is blogging

Kurt Cagle is blogging. Unfortunately it's Atom only blog (via Google's Blogger) and my RSS Bandit 1.2.0.114 (SP1 RC1) doesn't seem to understand it. Grrrrrr, how does thay say it - "Don't be evil" and "Google's mission: Organize the world's information and make it universally accessible and useful."? Rubbish! When ...

XQuery 1.0 and XPath 2.0 type hierarchy chart

Print this and stick near to your monitor: XQuery 1.0 and XPath 2.0 type hierarchy chart ...

August 26, 2004

XmlDocument is back

I had a foreboding of it. Dare Obasanjo: For this reason we've reverted the XPathDocument to what it was in v1.1 while new functionality and perf improvements will be made to the XmlDocument. Similarly we will keep the new and improved XPathEditableNavigator XPathNavigator class which will be the API for ...

"XSLT 2.0" and "XPath 2.0" books by Michael Kay are in print

In the related news: next generation of legendary books by Michael Kay are in print already and waiting for you in your favorite books shop. Here is related discussion in xsl-list. ...

August 25, 2004

No XSLT 2.0 Rec till 2006

Things turn slowly nowadays. Michael Kay on XSLT 2.0 perspectives: We're going to have to have a second Last Call because of the number of comments received. You can't do a Last Call in much less than four months. The CR phase these days for a complex spec is rarely ...

August 23, 2004

XQuery book hidden anagram

I'm reading "XQuery: The XML query language" book by Michael Brundage. Very well written and enjoyable to read book (well may be that's because my previous one was oh-boy-1000pages-of-math-and-pseudocode "Introduction to Algorithms" ? :). Anyway, here is what an interesting stuff I found in Michael's XQuery book. On page 29 ...

August 19, 2004

Real-world puzzle - Generic syntax for ASP.NET

Mikhail Arkhipov is trying to come up with any reasonable syntax for expressing generic controls in future versions of ASP.NET (he doesn't think it will be in Whidbey). So far all of them look plain ugly or unextendable (e.g. WRT to multiple types), needless to say malformed according to XML ...

August 15, 2004

My EXSLT.NET article is live at MSDN

My latest article "Building Practical Solutions with EXSLT.NET" has been published at the MSDN XML Developer Center. This is an overview of the EXSLT.NET library and its extension functions from the practical XPath/XSLT programming point of view. Basically I wanted to show how to use EXSLT.NET functionality in practice, so ...

Wesner Moise on Whidbey Hashtables

Wesner Moise (.NET Undocumented blog) compares old good .NET 1.X System.Collections.Hashtable and brand new Whidbey Dictionary<K,V>. Interesting. In short: New collision elimination strategy - chaining instead of probing. Yeah, array based linked list for each bucket. Allegedly it doubles perf! Who said linked lists are just interviewers' toy? As a ...

August 12, 2004

On Recent Paper on Turing-Completeness of XSLT and XQuery

Stephan Kepser (University of Tubingen) has presented a talk called "A Simple Proof for the Turing-Completeness of XSLT and XQuery" on recent Extreme Markup Languages 2004 conference. You can find the paper at the link above and report by Elliotte Rusty Harold here. Here are my comments on that paper. ...

The goal of the talk was to show that XSLT is Turing-complete by coding μ-recursive functions in XSLT. Fine, interesting. Let's see, in brief explanation of XSLT Stephan writes:

Templates may have a name. If a template has a name, it can be called by another template via this name:
<xsl:call-template name="f">

</xsl:call-template>
Instead of an identifier (Qname in XSLT terminology) like f there may be an expression that can be evaluated to an identifier, so that the template to be called may be determined at run-time. This is one of the features newly introduced in XSLT version 2.0 that we will make use of to simplify the exposition.
As Norm Walsh pointed out, that's wrong. XSLT 2.0 (at least the latest Last Call Working Draft) doesn't allow dynamic template calls. Name of a template to call must be known at compile time. That was XSLT 1.0 behaviour and looks like XSLT 2.0 won't break it. Saxon XSLT processor for years has an extension for allowing that, but that's just an extension and after all Saxon has lots of weird extensions, up to assignable variables. The fact is that XSLT 1.0 and latest XSLT 2.0 Last Call Working Draft doesn't support that.

Well, that means Stephan's proof is based on a proprietary XSLT extension (or even a bug). But that doesn't mean the proof of Turing-Completeness of XSLT failed. There is pure XSLT way to call templates by name dynamically. It's a method of "template references", apparently invented by Corey Haines and developed by Dimitre Novatchev (in fact the whole "FXSL -- the Functional Programming Library for XSLT" is based on that method).

Then Stephan proposes to build a stack in XSLT using a string:

XPath provides stings as data types and string functions which allow one to emulate stacks by strings. One needs a symbol separating objects on the stack. In our case it will be the slash (/). To push an element on the stack, we use the function concat to concatenate strings. It takes two or more arguments and returns their concatenation. To get the top element of the stack, we use the function substring-before which takes two strings as arguments and returns the substring of the first string before the first occurrence of the second string. When using the stack as the first and the separating symbol `/' as the second argument, the top of the stack is returned. In other words, the leftmost element of the string is the top of the stack. To get the rest of the stack, we use substing-after.
Interesting approach, but do we really need stack in XSLT for anything more practical than academic paper?

And the last problem Stephan struggles with is returning a value from a template. Well, academics love to solve problems, even when there are no problems:

Thus the key problem of computing with templates is the (assumed) lack of the ability to return a value from a subcomputation. How can one pass on the result of a subcomputation? We propose to recode the control flow for templates and to pass on results of prior computations by means of stacks.
The "(assumed)" word was inserted recently into the paper, it was more categorical assertion when I read it first some time ago ;) Of course it's easy to return a value from a template using result-tree fragments (XSLT 1.0) or temporary trees (XSLT 2.0):
<xsl:variable name="result">
  <xsl:call-template name="foo"/>
</xsl:variable>

Anyway, quite interesting paper...

IBM and Novell want XForms on Mozilla/Firefox

Cafe con Leche XML News: Hot diggety dog! IBM and Novell are teaming up to add XForms support to Mozilla! If I were Microsoft, I'd be very, very worried right now. ...

MVP chats / MVP chats on XML topics

Btw, MSDN Technical Chats now can be hosted by MVPs. Cool! Recent Online Chat with Microsoft XML Team was tremendously interesting, but too short (45 min?). Being MVP I wonder what if we arrange some chats on actual XML topics, like XQuery, new stuff in System.Xml v2.0, new XML editor ...

August 11, 2004

XPuzzle

Ok, this is a simple one, if XML + XSLT = 5 XPATH + XPOINTER = 10 RSS + ATOM = 7 XINCLUDE + RELAXNG = 11 Then what is XHTML + MATHML = ? ...

August 8, 2004

"Essential XML Quick Reference" book free download

TheServerSide.NET and Developmentor offer free download of the "Essential XML Quick Reference: A Programmer's Reference to XML, XPath, XSLT, XML Schema, SOAP, and More" book by Aaron Skonnard and Martin Gudgin (PDF version). 432 page book covers XML 1.0 and Namespaces, DTD, XPath 1.0, XPointer, XInclude, XML Base, XSLT 1.0 ...