On dingo kidneys

October 28, 2003

According to Ugo Cei on the cocoon-users mailing list, XML isn’t worth “a pile of fetid dingo kidney” (TM) as a scripting language.

After writing lots of XSLT lately, I must agree.

I like XSLT as a transformation language. XPath in particular brings a lot of power to template matches and document tree queries. But the XML-based syntax is a pain, even more when you have to write some string manipulation or similar glue code.

Current dream this side of my screen would be to write Python code inside XSLT templates. I’m sure dingoes have dreams too…


StAX – efficient XML pull-parsing

September 18, 2003

StAX looks like one more API to keep an eye on – Elliotte Rusty Harold has an introductory article on xml.com, and another article from Oracle compares it to DOM and SAX.


There’s no such thing as a blank namespace

August 9, 2003

Tim Bray clarifies this somewhat confusing issue: XML elements can have no namespace, but there’s no “blank” namespace.


Mine is longer than yours…

May 24, 2003

but it’s much more readable I think.
Steven helps
Tom
with some XSLT, counting the number of lines that are needed to do the job.

Hmm..I don’t like counting lines of code. Maybe even more in XSLT than in java code, I’m always focused on readability, even if it means slightly longer code or a few more classes or templates.

Also, I like to keep usage of xsl:choice and xsl:if to the bare minimum in XSLT – using multiple templates for different cases is often clearer.

So, here’s my version of the same thing – I know Steven’s version is most probably a quick hack, but if Tom needs to be “converted” to XSLT, better show him the cleanest possible thing. This version can certainly be improved too, any takers?

Read the rest of this entry »


Improvising XML

May 21, 2003

I like Simon St.Laurent‘s view on XML allowing improvisation in data structures. Thinking about it, that’s what I’ve been doing all the time, writing XML example documents first and DTDs or schemas later on (if needed).

I also like improvisation in music: playing something unprepared with a group of people that you trust to react fast enough when something happens, to steer the “project” in the right direction. Lots of parallels here.


Native XML scripting

April 1, 2003

How about a scripting language that manipulates XML natively, allowing a document’s structure to be navigated, queried and modified using a familiar ECMAscript-like syntax?

Native XML scripting does just this, and frankly the following code:

function calcTotal(order) {
var total = 0;
for (var item in order.item)
total += item.price * item.quantity;

return total;
}

is soo much more readable than the XSLT equivalent. Interesting!