Category: XML

  • my 2017 Windows working environment

    All these packages resp. utilities do not require Windows admin rights for getting them “installed” – actually they do not need “a Windows system installation”.

    Below C:\Users\jhayek I created a couple of subdirectories:

    • opt: every package resp. utility has its own subdirectory below there
    • bin: some .bat and .sh (BusyBox ash) scripts go there

    Packages resp. utilities:

    • GNU Emacs
    • busybox-w32: includes a shell and a lot of Unix utilities
    • Strawberry Perl
    • https://ConEmu.github.io — a Windows console alternative, where you can paste text w/o using the mouse  😎
    • xmlstarlet

    After having worked with this set-up for a couple of days, I have to admit: this is not just a minimalist Unix-ish working environment, but it is rather enjoyable working environment. I do not have the GNU utilities with all their advantages (nice long command line options and lots of features) – but for most purposes the utilities built into busybox-w32 are good enough for my purposes. What a great idea it was to think of “busybox for Windows” a couple of days ago – and actually find “busybox-w32”!!! I had to consider a lightweight alternative of Cygwin, because on my new client’s Windows computers it’s not available.

    ConEmu makes busybox-w32 and its shell (the “ash”) even more enjoyable.

    GNU Emacs is as good as always – I can’t really describe how sad it is to not have it available in a serious working environment.

    Strawberry Perl so far has all the modules, that my utilities need. I am really glad to have that “distribution”.

    xmlstarlet is my XPath and XML Swiss Army Knife.

    With all these utilities and packages available it’s even quite fun to work on Windows 7  😆

  • XQuery/Inserting and Updating Attributes – Wikibooks, open books for an open world




    <!–

    www.bibleserver.com | 522: Connection timed out


    body{margin:0;padding:0}
    <!–[if lte IE 9]>/cdn-cgi/scripts/jquery.min.js<![endif]–>
    /cdn-cgi/scripts/zepto.min.js<!–
    /cdn-cgi/scripts/cf.common.js

    Error
    522
    Ray ID: 3a8c5df38cb61583 • 2017-10-05 00:47:29 UTC

    Connection timed out


    You

    Browser

    Working


    Frankfurt

    Cloudflare

    Working


    www.bibleserver.com

    Host

    Error

    What happened?

    The initial connection between Cloudflare’s network and the origin web server timed out. As a result, the web page can not be displayed.

    What can I do?

    If you’re a visitor of this website:

    Please try again in a few minutes.

    If you’re the owner of this website:

    Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish. The most likely cause is that something on your server is hogging resources. Additional troubleshooting information here.

  • I want to get sheet music prepared as MusicXML – where would I post the job?

    And with “job” I certainly mean sort of a “contract” and money – like 1 Euro or U.S. Dollar per song.

  • a car and a website – do they have anything in common?

    Within the car I have in mind and I came across, its parts communicate using CANopen. The car’s software got mostly implemented in Ada, and once there existed a (home-brewn) software generator Ada code for CANopen message definitions. From the CANopen message definitions the generator created:

    • data structures in Ada
    • marshalling code
    • de-marshalling code

    There was still an ongoing development of the car, but because the generator got lost or abandoned, the software developers had to maintain and extend the generated code themselves. That’s a violation of a basic principle of course: Do not touch generated code! And it’s also quite a challenging task. They did a great job, but certainly they failed occasionally, and there are some cars out there with incorrect code.

    I found the situation quite sad. And that triggered my creativity.

    • I created a CANopen definition language in XML using RELAX-NG.
    • I reconstructed the definitions of the CANopen messages used in the car.
    • I developed a new generator.
    • I created the code for the 1st car, compared it to the existing code step by step, … and finally the car still worked.
    • I did so for all the cars’ software I found around. But unfortunately the cars themselves were not available on site.

    Now for my current project: web development in HTML + Perl + JavaScript + CSS + “a home-brewn web-template-framework in  Perl”. And where would be the similarity? The home-brewn web-template-framework got abandoned. Just the generated code is still in use and gets extended and maintained continuously. So new HTML does no longer get created through the framework but rather on the fly through JavaScript. That’s quite a funny and exciting way of writing HTML. And I am deeply impressed.

    I am not sure, which framework would be the right thing to suggest for the next generation of this software.

  • creating diary entries from my (little) blog articles

    1st approach: xmlstarlet with an XPath expression (rss/channel/item/link) + shell wrapper.

    2nd approach: XQuery script looping over rss/channel/item (+ shell wrapper). I am glad to upload it to my github area, in case somebody is interested.

    Update 2016-08-26: By default WordPress creates an RSS feed with just 10 entries. I don’t create my diary entries (as described above) a couple of times a day, so sometimes it may very well make sense to look back like 20 or more entries. I did not immediately recognise, that figure is a parameter WordPress allows you to set for your blog. I rather came across this forum thread:

    And I found the “expert’s” opinion rather annoying. Luckily enough I was courageous enough to search for the suspected parameter in the Settings / Reading section. I am glad it’s there.

  • how would I do something like “disable-output-escaping yes” in XQuery?

    I am transforming an bank account statement from HTML to a text file (meant to be read by humans) using XQuery. And I want to use “<” and “>” in the output. But XQuery serialisation does the usual XML / HTML escaping. I wonder, how I can get around that unwanted rewriting.

  • XQuery: “declare boundary-space preserve;” does not apply wherever you expect it




    <!–

    www.bibleserver.com | 522: Connection timed out


    body{margin:0;padding:0}
    <!–[if lte IE 9]>/cdn-cgi/scripts/jquery.min.js<![endif]–>
    /cdn-cgi/scripts/zepto.min.js<!–
    /cdn-cgi/scripts/cf.common.js

    Error
    522
    Ray ID: 3a8c6029598d267e • 2017-10-05 00:48:59 UTC

    Connection timed out


    You

    Browser

    Working


    Frankfurt

    Cloudflare

    Working


    www.bibleserver.com

    Host

    Error

    What happened?

    The initial connection between Cloudflare’s network and the origin web server timed out. As a result, the web page can not be displayed.

    What can I do?

    If you’re a visitor of this website:

    Please try again in a few minutes.

    If you’re the owner of this website:

    Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish. The most likely cause is that something on your server is hogging resources. Additional troubleshooting information here.

  • 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.

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

    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:

    declare decimal-format local:de decimal-separator = "," grouping-separator = ".";
    declare decimal-format local:en decimal-separator = "." grouping-separator = ",";
    let $numbers := (1234.567, 789, 1234567.765)
    for $i in $numbers
    return (
     format-number($i,"#.###,##","local:de"),
     format-number($i,"#,###.##","local:en")
    )