September 26, 2002

BEA's native XML scripting and Jelly

Web services

James Strachan continues his comparison of native XML scripting in BEA Workshop and Jelly. (XML native scripting originally pointed out by Carlos Perez).

I would compare the native XML scripting extension of JavaScript with XSLT, rather than with Jelly. With the BEA XML scripting solution you can manipulate XML the same way you can do it with XSLT, except that you do it in a more procedural form. Gone is the pattern matching approach, and the very functional style of XSLT programming. In is the procedural, more understood processing model, at least by the vast majority of Java and JavaScript programmers.

It is debatable whether we need a new syntax to be able to integrate XML data types in a normal language. Most of the access and manipulation features described in the article can be achieved by using something like JXPath or Jaxen. Both these libraries access nodes or nodesets in an XML DOM representation using XPath, and return them for further manipulation. I found this to work very well in all the cases I needed such access.

The inline XML assignment in the native XML scripting (does it have a name?) is IMO just a syntactic sugar, and it actually promotes dangerous mixing of content and logic. Pretty soon we'll start seeing scripts which mix XML markup with logic to fill in the template, similar to what JSP allows you to do today.

Another thing which is worrisome is the XML processing model introduced by the native XML scripting. One of the great things about XSLT is the pattern matching oriented programming model, the so-called rule-based programming. Of course, you can still do procedural programming in XSLT using <xsl:for-each> and <xsl:if> to iterate over the children list, but that is something to be avoided since it ties the stylesheet to a particular structure of the input documents. The rule-based programming model is no longer available with the native XML scripting solution, not unless is explicitly coded by the programmer.

As far as Jelly is concerned, my gosh, it's amazing! Last time I checked out Jelly was way back in December 2001, when I started working on Anteater, a functional testing framework for SOAP clients and services. Jelly seems to be now a complete programming language with an extensible syntax (and semantics of course) based on XML! I'm not sure whether this is good or bad, I simply hate the XML syntax for anything which is procedural. We'll see what it will evolve into, and especially how people use it! Good luck with it James!

Posted by ovidiu at September 26, 2002 01:38 AM |
 
Copyright © 2002-2016 Ovidiu Predescu.