Category: Uncategorized

  • editing XML documents in emacs using nxml-mode

    One good reason for not not authoring in XML is not having a suitable editor or IDE. I personally use and recommend emacs and James Clark‘s nxml-mode. I create and modify all sorts of XML documents this way. If you supply nxml-mode with the right schema for your document, nxml-mode can even help you with tag completion and document validation. nxml-mode makes use of schemas in RELAX-NG, co-created by James Clark. RELAX-NG schemas are rather easily created, if not yet just available, as for DocBook, DocBook Website, DocBook Slides, and many, many other XMLs.

    Trang” is your tool for creating a RELAX-NG schema:

    • if you want to convert a DTD into a RELAX-NG schema,
    • if you want to derive a RELAX-NG schema from a couple of XML files of a specific kind,

    I have done that a dozen times, it does work.

    Here you find nxml-mode’s manual page.

    Your mileage may vary …
  • DocBook Slides

    • If you really are into XML,
    • if you even write your documents in XML ie. DocBook,
    • then you will love DocBook Slides

    The Slides Document Type is an XML vocabulary derived from
    DocBook. It is used to create presentations (slides, foils, whatever
    you call them) in HTML or print.

    Presentations are by nature
    visual and the Slides stylesheets
    provide a wide range of options to control how the transformation from
    XML to HTML is performed.


    One good reason for not not authoring in XML is not having a suitable editor or IDE.

      I personally use and recommend emacs together with James Clark’s nxml-mode. Your mileage may vary though …
    • want to get signalled, when a command line job on your computer is done?

      I have a long list of cpanm jobs,
      don’t want to put them in a batch all toghether,
      and want  to get signalled, when each of them is done:

      $ while true; do beep; done

      In my case the beep is acutally just the flashing of an xterm window.

      Update:
      Yes, notify-send is far, far, far superiour, growlnotify on OS X.
      Thanks for the pointers!

    • best practices in shell script programming – colons

      My snipplet for an if/then/else in shell scripts looks like this:

      if true

      then :

      else :

      fi

      The colons make that code syntactically complete, w/o the colons you run into a syntax error. The colon is the “null op” of (Bourne) shell scripting.
      And the colons usually remain there for the remainder of the life of that code.
      Have you noticed, that the youngsters, that talk about snipplets nowadays seriously think, they invented them? True, I guess, they created the term. Just the term.

    • best practices in shell script programming – double quotes

      You do know the result of this:

      a=A; echo $a

      But are you just as sure here?

      a=A; b=B; echo $a.$b

      That depends on the shell, you are using. So I suggest you better write it this way:

      a=A; b=B; echo ${a}.${b}

      Enclosing variable names in curly braces is quite often a good idea.
      Look at the following piece of code:

      case $var in

        x*)

          echo var starts with x

          ;;

        *)

          echo var starts with something else

          ;;

      esac

      Looks alright, doesn’t it?
      No, it’s does not. If that variable had not been assigned a value before or is of zero length, you will see an ugly syntax error occur.
      Therefore enclose the variable in double quotes like here:

      case “$var” in

        x*)

          echo var starts with x

          ;;

        *)

          echo var starts with something else

          ;;

      esac

      There is no good excuse for not doing it anywhere. It may look ugly and unnecessary, but it will help. That’s the way shell scripting is. I learned this from Jürgen Gulbins around 1987, when I enjoyed working for him. This series of articles is dedicated to him. I owe him a lot.
    • App::cpanminus – a new CPAN installer

      How to …:

      $ perlbrew switch stable # resp.
      $ perlbrew switch perl-5.12.1
      $ cpan  App::cpanminus
      $ cpanm App::cpanminus
      $ perlbrew install-cpanm # use this variant!!!

      $ perlbrew switch perl-5.10.1
      $ cpan  App::cpanminus
      $ cpanm App::cpanminus
      $ perlbrew install-cpanm # use this variant!!!

      To be continued …

    • cookie hell …

      sites w/o general admission so far:

      • xing.com
      • Google Calendar

      exceptions:

      • draft.blogger.com
      • www.twitter.com 
      • www.blogger.com 
      • mail.google.com
      • www.facebook.com 
      • chrome.google.com
      • www.inkedin.com
      • www.google.com
      • fritz.box – my multi-functional router
      • oreilly.com

      I would love to be able to not give further general admissions to cookie senders.
      Cookies kill me, sort of.

    • AdBlock …

      Ads are actually BLOCKED FROM DOWNLOADING now, instead of just being removed after the fact!

      One of these milksops told me “the other day”, that wouldn’t be true, and I couldn’t prove him wrong then. It hurts having trusted yet another shameless lie.


      If you notice Google Chrome as a tag here, that means, there is now AdBlock for Google Chrome.
    • creating my 1st DocBook Website web-sites

      I have the DocBook XSL book in front of me (opened at “Chapter 31. Website“), asking myself and the world (irc://irc.freenode.net#docbook) silly questions, like the ones, you can find as my recent articles on this blog.

      I want to change a couple of pretty raw vanilla DocBook web sites to pretty raw but neat vanilla DocBook Website web sites during the next couple of hours. There is other work to complete pretty soon, so I rather complete this thing now.

      I am using docbook-website-2.6.0/example from Sourceforge (look around here!! ((FIXME))) (of course as example-JH-0, so I can always diff to the origin).
      Their Makefile-example.txt is now my Makefile, I just had to adapt DOCBOOK_WEBSITE and XSLT:

      • DOCBOOK_WEBSITE=/usr/local/docbook-website-2.6.0
      • XSLT=xsltproc


      Try this:

      $ make clean
      $ make realclean
      $ make depends
      $ make

      Update / 2010-07-14:
      I have made pretty good progress during the last couple of days.
      I converted a couple of plain DocBook web-sites (HTML!!) to DocBook Website, and I rather sense some satisfaction there. You can find those web-sites right here in the right column listed as my most exciting web-sites. Sorry for the bragging, but the Website guys did a rather good job, so even me cannot spoil that a lot.
      Right, and a web-designer mate of mine will show up on Friday, and we are going to discuss the replacement logos for all the NDW-logos around there. And a very big “thank you!!!” here to Norman for all his good work!!!

    • DocBook Website – where to get the Relax-NG schema from?

      I found it at SourceForge.
      I really love editing XML in Emacs’s nxml-mode. I did mention that at my DocBook Wiki home page already.