XML.com: Comparing XSLT and XQuery
ARE YOU KIDDING ME??? Come on now! I thought we were past the days that authors took a modern W3C spec in XQuery 1.0 and compared it to a 5 year old spec in XSLT 1.0 touting the "GREAT AND AMAZING BENEFITS" of using XQuery instead of XSLT, assuming that no one will notice the attempted con-job. I'll be honest, there are two things keeping me from spending the next hour taking your article and punching BIG FAT HOLES in it, tearing it into little tiny pieces, and exposing it to anyone paying attention for the fraudulent crap of an article that it is:
[UPDATE: * see bottom of extended post]
- I'm working against a *MUCH* more important deadline than is worth spending any more time beating down Yet Another Sad Attempt at Glorifying XQuery by Comparing it to XSLT 1.0
- We share a similar signature type with "First_Initial. Middle_Name Last_Name" and our middle names are the same.
Actually if not for the first the second wouldn't really buy you more than 12 hours or so to rewrite this using a modern spec to modern spec comparison... but maybe you dont care. Guess we'll find out.
So here's my offer to you:
Re-write this article using a comparison between XQuery 1.0 and XSLT 2.0 and either ask XML.com to repost the new article or write a comment that points to wherever you want to host it. Then shoot me a ping and if it seems like a much more realistic and fair comparison I will subsequently make an announcement as to its availability and cancel all plans to take things to the next level. What the next level? :D My full and unwavering attention to taking your post line by fraudulent line to a whole new level of understanding that I promise is not going to be a positive thing. For you. I may even invite a friend or two to join in on the festivities just to spice things up a bit.
I'll give you 1 week.
To anyone else who reads this post. Don't bother wasting your time with the above article. Its not only a fraudelent attempt to lure you into believing that XQuery is the defacto replacement to XSLT but it simply sucks! Worthless. A completely waste of your time. While its not even worth the effort to take a measurement I can guarantee you that I gained at least five times the amount of useful and accurate information earlier this evening skimming the pages of the National Enquirer at the check out line than I did reading this article. In fact it could easily be double that number.
Guess we'll see how the next 7 days pans out. Clocks tickin...
[UPDATE: You know what sucks about this? XQuery is actually a really cool language with tons of easy ways to query various data stores in a language more focused on the Query than the Transformation -- While you can do everything with XSLT 2.0 that you can with XQuery elegance does have to factor into things and in a lot of cases XQuery is simply the better choice for the job. But more damage is done by articles like this than good could ever become of it... I just don't get it.]
TrackBack URL for this entry:
http://www.xsltblog.com/xslt-blog-mt/mt-tb.cgi/716
I tend to agree with your opinions. I liked XQuery but not the article. I’ll try to write something this weekend … eek. can we have more then one week?
:D I actually don’t plan to do anything quite as drastic as I kind of lead to in my post… I simply want to make sure that all the facts are properly laid out and if that happens gradually via the community and I have things to point to then theres no need to open my loud mouth any wider than it already tends to be :D Please let me know when you have something and I will make sure I send out a pointer!
I think you’re over-reacting pretty strangely. A lot of people are looking to move directly from XSLT 1.0 to XQuery, and I’m not sure that an XSLT 2.0 to XQuery comparison would be useful for that large case.
Apples to apples is great, if you actually care about both apples. If you don’t, you don’t.
Hey Simon,
From that standpoint you’re point is well taken. However I am not one of those who see XQuery as a replacement technology but rather a technology that is better suited to Query XML data stores using a less verbose syntax. From my standpoint it aggravates me when I see authors compare XQuery 1.0 to XSLT 10 without recognizing the fact that:
a) there is an XSLT 2.0 on its way that is based on the same foundation and can do all that XQuery can do, sometimes more.
b) but, for those who find XSLT awkward or would prefer a less verbose syntax, or (fill in the blank as to whatever other reasons one might have) then XQuery flat out kicks a$$.
Thats really all I am asking. If you’re going to do an article on the wonderful benefits of XQuery compared to XSLT 1.0 then don’t ignore the fact that most of what is being compared is now a part of XSLT 2.0.
I do like the way you phrased your reasonings for looking forward to XQuery. They make sense. And if this author would have started off by stating something similar and recognizing XSLT 2.0 exists then I would have applauded his efforts. He didn’t so until such time as he does I simply have to stand my ground.
Thanks for taking the time to comment!
<M:D/>
Hi Simon,
> A lot of people are looking to move directly
> from XSLT 1.0 to XQuery
Probably I am living in a very isolated environment but I haven’t heard about a single case of an XSLT 1.0 developer looking forward to move directly from XSLT 1.0 to XQuery.
Not a single message stating such intention on xsl-list — and this is where XSLT developers publish on a daily basis.
Also, in his comments following the article in xml.com, David Eisenberg himself calls his article “worst. simile. ever.”
So, what did I misunderstand from your comment?
Cheers,
Dimitre Novatchev
a propos the statement ‘> A lot of people are looking to move directly
A lot of people who use XSLT 1.0 are looking to use XQuery. Although the implication is strong that these same people will absolutely refuse to use XSLT 2.0 it is not spelled out, and personally I would think it a very strange intention.
A lot of companies that have solutions based on XSLT 1.0 are looking to move towards XQuery. Of course as is always the case in I.T any companies stating their intentions as such are not in any way trying to sound on the cutting edge or basing their decision on not knowing anything about what their plan entails.
A lot of people are looking to move directly from an XSLT 1.0 implementation to an XQuery implementation. I can think of one company that said something like this, but they seem to have muddied the waters since.
am I correct in any of these?
I don’t expect ‘proper’ XSLT developers to be leaping from XSLT 1.0 to XQuery. Once you’ve made the investment in learning XSLT 1.0 thoroughly, you may as well stay in XSLT. (For some group of developers, the XSLT approach is preferable to start with, but everything I’ve heard suggests that group is a distinct minority in the programming world.)
The group that I expect to make the leap from XSLT 1.0 to XQuery contains developers who were never particularly comfortable in XSLT 1.0. A lot of people bounce off of XSLT completely, or use it on the edges of their projects as lightly as possible and only when it’s clearly easier than the alternative.
For a lot of those folks, XQuery looks like a better answer. I’m no fan of XQuery (or XSLT 2.0 for that matter), but I’ve heard a fair amount of this excitement from developers looking forward to working with a more familiar syntax.
Hmm…
I’m certainly not known as a fan of XSLT, though I’ve softened up to it over the years. I even use XSL-FO once in a while.
If an XQuery syntax for XSLT 1.0 (without the extra baggage of the XSLT 2.0/XQuery family) was available, I’d probably use it fairly frequently. A lot of programmers would likely use it exclusively. XQuery syntax and structure is still kind of alien to many programmers, but less alien than XSLT.
And yes, much of what I’m describing comes from observing others. That said, I spend a lot of lot of time observing others as part of my day job (figuring out which if any XML books to publish), so these aren’t simply random bar comments. (Bar comments are definitely included in the sample, however!)
I think the misunderstanding comes from these statements: “Yet Another Sad Attempt at Glorifying XQuery” and “If you’re going to do an article on the wonderful benefits of XQuery compared to XSLT 1.0…”
That was never my intention at all. I did a search through the original article, and the words “better,” “best,” “worse,” and “worst” appear nowhere in it. (The word “good” does, in reference to good HTML practices.) There are only a couple of comparative adjectives ending in “er” and none ending in “est.”
My purpose was a “just-the-facts-ma’am” recitation of the things I discovered while doing the same task two different ways. I never even thought of using XSLT 2.0, since XSLT 1.0 has met my needs more than adequately. (If I am the Last Person On Earth Using XLST 1.0 and Xalan, please let me know!)
In any case, since you asked so politely, a revision, still in progress (feel free to make suggestions) is at http://catcode.com/revised_xml_article/xslt_and_xquery.html
Ten points for making me laugh…
Thanks for the the response David. I do tend to be fairly dramatic in my comments but I find that when I feel there is something important to be brought out dramatic headlines and comments gain more attention than do the opposite. 95% of the time I end up eating my words but I would much rather eat my words after the community has had a chance to pound through a topic voicing their own opinions on the matter. If I walk away with a certain feeling on something after reading an article generally speaking I’m not alone. In fact I was pointed to this article from another XSLT community member whos feelings were right in line with mine so I can feel confident that I wasn’t alone on this one. Given the fact that this is XSLTBlog I generally will take a defensive response in favor of XSLT to ensure that the point from an XSLT developers standpoint is completely understood. While you suggest that you hadn’t thought of using XSLT 2.0 as 1.0 has met your needs, others, like myself, feel differently. Given that your article was given an xml.com URI there are those who are going to look at your post and state “wow! I had no idea XQuery was so cool and XSLT so limited” not making the connection between the fact that you are refering to 1.0 instead of 2.0.
When there are XSLT blanks left to fill I will most certainly fill them. Its kind of my job. :D
I appreciate the fact that you have decided to rewrite your article and to be honest I do believe that the original article the way it was is a good piece. Just that one added factoid that “by the way… in case you didnt know theres an XSLT 2.0 as well built on the same XPath 2.0 foundation as well as the same data modle… I dont personally plan to use it but…”. I really don’t mean to suggest any exact verbage nor do you even have to go through all the effort. For that I am seriously impressed!
As such I plan to follow-up this comment with a free ad for one of your titles as a thank you for paying attention to the concerns of your readers…
Cheers :)
<M:D/>
Apples and oranges. I personally despise XQuery - I find that its mixed syntax and its overt requirements on data-typing for XML manipulation can make for some seriously nasty debugging sessions, I’ve yet to see two XQuery engines that actually work equivalently for anything other than the simplest queries, and suspect that the SQL crowd, the ones most likely to actually want to USE XQuery, will find it arcane and completely counter to their knowledge of SQL.
I prefer to use XSLT 2.0 when I can, XSLT 1.0 when I can’t, and XQuery when someone’s paying me a lot of money to write a book. However, I’m also an abnormal programmer (yeah, I LIKE XSLT) so I will say that for some people XQuery may very well be THE way to go. Personally, though, I think that won’t happen until the W3C comes up with a DDL analog for XQuery, something that lets you define a data model that can be superimposed into a a database, XML file, or binary object.
Indeed (and there is a vague fuzzy article coming on here) it could very well be that such an XDDL would have most of the characteristics of … um … XSLT 2.
I struck upon the original article while searching for XML transformation techniques. And even though the article compared XSLT 1.0 with XQuery, I found XSLT to be the straight forward choice for transformation. To be honest, I’m a little confused seeing people try to use XQuery for data transformation. It is clearly not one of the goals defined for the language. To me, it’s somewhat like trying to use SQL to output a pretty formatted report. It can be done, but it’s not what it is meant to do.
Thanks for your comments Yaser. I completely agree with your evaluation. In fact I find very few people except for those very close to the action e.g. XQuery working group members; who seem to think differently. Obviously there are those who seem to think XQuery is the silver bullet they’ve been looking for to solve their data access and transformation needs and if this is the case more power to them. But I’m definitely not one of those people and it seems neither are you nor most people in whom I speak to on this subject.