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… Continue reading after a couple of months using XPath and xmlstarlet I created my first lenghty XQuery script using Saxon9HE

 XQuery: format-number: using $decimal-format-name is really, really weird

https://www.w3.org/TR/xpath-functions-30/#func-format-number Can you imagine, that the 3rd argument needs extra double quotes around? And it’s not easy to find an example showing this, but here I found one: https://www.amazon.de/dp/9671317502 – “Web Coding Bible” declare decimal-format local:de decimal-separator = “,” grouping-separator = “.”; declare decimal-format local:en decimal-separator = “.” grouping-separator = “,”; let $numbers := (1234.567, 789,… Continue reading  XQuery: format-number: using $decimal-format-name is really, really weird

how to deal with folders on GitHub, although there is no obvious support for them

http://shop.oreilly.com/product/0636920033059.do This introductory guide teaches you how to use GitHub to manage and collaborate with developers, designers, and other business professionals more effectively. You’ll learn about project transparency, collaboration tools, the basics of Git management, and how to make changes yourself—without having to bother your development team. https://library.oreilly.com/book/0636920033059/introducing-github/20.xhtml?ref=toc#idp611504 – Working with Folders https://library.oreilly.com/book/0636920033059/introducing-github/20.xhtml?ref=toc#idp622720 – Creating a Folder https://library.oreilly.com/book/0636920033059/introducing-github/20.xhtml?ref=toc#idp626192 – Renaming a… Continue reading how to deal with folders on GitHub, although there is no obvious support for them

Published
Categorised as Git SCM

XQuery: padding an integer or a number, but not with “0”

I found this function, but it pads on the right: http://www.xqueryfunctions.com/xq/functx_pad-string-to-length.html : functx:pad-string-to-length I derived pad-string-to-length-on-the-left from it: https://github.com/JochenHayek/misc/blob/master/xqueryfunctions/pad-string-to-length-on-the-left.xqy https://github.com/JochenHayek/misc/blob/master/xqueryfunctions I use it around format-integer and format-number, e.g. let $net_amount_formatted := local:pad-string-to-length-on-the-left( format-number( data($invoice/@net_amount) , ‘#,###.#####’ ) , ‘ ‘ , 12 )

XPath and XQuery Functions and Operators 3.0: Formatting integers and numbers

https://www.w3.org/TR/xpath-functions-30 https://www.w3.org/TR/xpath-functions-30/#formatting-integers https://www.w3.org/TR/xpath-functions-30/#formatting-the-number http://www.xqueryfunctions.com/xq/functx_pad-integer-to-length.html http://www.xqueryfunctions.com/xq/functx_pad-string-to-length.html https://github.com/JochenHayek/misc/blob/master/xqueryfunctions https://github.com/JochenHayek/misc/blob/master/xqueryfunctions/pad-string-to-length-on-the-left.xqy I need to pad a decimal number to a given length with leading white space. Looks like there is nothing in the “built-in library”. Looks like there is no functx:pad-integer-to-length as well, but functx:pad-string-to-length looks intriguing – but it only pads on the right. I created a variant, that pads on… Continue reading XPath and XQuery Functions and Operators 3.0: Formatting integers and numbers

2016 Turkish coup d’état attempt

https://en.wikipedia.org/wiki/2016_Turkish_coup_d’état_attempt President Recep Tayyip Erdoğan and his AKP government being removed from office? Isn’t that an intriguing idea?!? If I am not mistaken, the Turkish generals are traditionally quite pro-Israeli, I am sure they are not pro-IS, they can’t really be worse then an Erdoğan government, …

Published
Categorised as Turkey

the Mercurial SCM: TortoiseHg, …

https://en.wikipedia.org/wiki/Mercurial https://www.mercurial-scm.org https://www.mercurial-scm.org/wiki/QuickReferenceCardsAndCheatSheets https://www.mercurial-scm.org/wiki/TortoiseHg http://TortoiseHg.bitbucket.org The driver program hg – a reference to Hg – the chemical symbol of the element mercury.

XmlStarlet UG on “Studying Structure of XML Document” – “xmlstarlet elements …”

http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139665568 http://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html I really like “xmlstarlet elements …” – but these very nice and useful XPath expressions come without index. So what if you really, really need them with indexes? I am not sure, you can write a general utility, that rewrites these XPath expressions without index into XPath expressions with index, but for my… Continue reading XmlStarlet UG on “Studying Structure of XML Document” – “xmlstarlet elements …”

Jenkins CI jobs described in YAML – “Jenkins Job Wrecker” and “Jenkins Job Builder”

https://github.com/openstack-infra/jenkins-job-builder http://docs.openstack.org/infra/jenkins-job-builder/ http://docs.openstack.org/infra/jenkins-job-builder/definition.html http://docs.openstack.org/infra/jenkins-job-builder/definition.html#module-jenkins_jobs.local_yaml : include, include-raw, include-raw-escape – keeping building blocks in separate files – good for dealing with Shell scripts etc as build steps http://docs.openstack.org/infra/jenkins-job-builder/quick-start.html http://docs.openstack.org/infra/jenkins-job-builder/execution.html https://www.mediawiki.org/wiki/Continuous_integration/Jenkins_job_builder (JJB) https://www.cloudbees.com/jenkins/juc-2015/presentations/JUC-2015-USEast-Scaling-Your-Jenkins-Do.pdf And this software lets you extract Jenkins jobs to YAML: https://github.com/ktdreyer/jenkins-job-wrecker (JJW) I don’t know, how well the two (“builder” and “wrecker”) work together – how does the… Continue reading Jenkins CI jobs described in YAML – “Jenkins Job Wrecker” and “Jenkins Job Builder”