after a couple of months using XPath and xmlstarlet I created my first lenghty XQuery script using Saxon9HE

“In production” I have been using a Bash+xmlstarlet script, that I wanted to optimise by rewriting it into an XQuery script. This would be my 1st XQuery script after a couple of months of exercising XQuery through Priscilla Walmsley’s book and Saxon9HE – a couple of hours per week only because of my entire workload.

During the last couple of days I managed to complete the rewriting of my utility. I acquired quite some experience, and now I am rather satisfied with my work – and myself  😎

I learned, how to use regular expressions in XQuery – of course with decades of using regular expressions in various languages as a starting point.

And I learned, how to use decimal number formatting – in 2 different technical “locales” in parallel. Apparently “left white space padding” of decimal numbers is something the creators of XQuery did not genuinely incorporate into the XQuery environment. Decimal number formatting in XQuery is rather different to how you do it in C or Perl, it resembles more how you do it in Fortran or COBOL – and I don’t mean to criticise that approach. All over it is just very, very different – and confusing, if it comes to details.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.