First the good news: the latest version of PN2 has been released to sourceforge and the pnotepad.org website. It has lots of good new features, and loads of bug fixes for annoying problems with previous releases.
Then the bad: there is a bug in the global tools code which means that closing the options dialog with global tools configured crashes PN 2. You don't lose any settings, but may lose data. There will be another release of PN 2 in a couple of days to fix this problem.
From the "what's new in PN 2 0.5.5" department, is the "middle-click on a tab to close it" feature. This is now my favorite feature (for at least the next ten minutes). Go on, try it, you'll soon be addicted. The only problem is that now any application that doesn't support this feature will irritate you. a lot.
Firefox does support it - wahey!
So, try it; love it; petition others to implement it and make the world a better place.
This is the first in a series of what's new in PN 2.5.5 style articles. maybe.
I am writing my MSc thesis at the moment, and am trying to do it in docbook - the same way I'm trying to write the PN documentation (slowly!). Transforming docbook into PDF takes an impressive toolchain, XML & XSL -> XSL:FO -> PDF = XML editor, docbook stylesheets, xsltproc, fop (java + xalan + saxon + apache fop). Just a couple of tools, you might think - but they took me ages to collect and configure into a working setup.
I'm trying to write this explanation to keep a note for myself on how I did things. The various sections are in no particular order, so my apologies if it seems to be a ramble.
You can get xsltproc for windows from the website referenced in the References section. You need to retrieve libxml2 (which contains libxml2.dll, xmlcatalog.exe and xmllint.exe), libxslt (libxslt.dll, libexslt.dll and xsltproc.exe), iconv and zlib. Download all the zips, and extract the .dll and .exe files. These are scattered around the bin and lib directories inside the zip files.
To transform the DocBook XML into XSL:FO XML (for later conversion to PDF), you need to get the DocBook XSL stylesheets. These need to be extracted and stored in a sensible location on your hard-disk.
FOP is the tool from the Apache XML project that converts from an XSL:FO formatted XML file (a file full of layout instructions) into other formats such as PDF. FOP is a java tool so you'll need a Java runtime. I downloaded the binary version, and also needed to download JAI in order to get picture insertion working. You need to install JAI and then the FOP tool will pick it up automatically. The FOP site also references something called JIMI but I couldn't get this working.
If you're not really into the world of XML (I feel like I know a good bit about it, and am barely scratching the surface compared to many others) then you may not really know a lot about DTDs, schemas and catalogs. Simply put, the DTD and Schema things are often used by the tools listed above to validate XML content - they define a contract for the content of XML files. If you just run these tools without a catalog, then they will attempt to retrieve these contract files from the internet. This takes a long time and really slows down the conversion process.
It took me ages to work out how to get catalogs to work properly with xsltproc, there was no windows documentation so I pieced it together from e-mails and snippets found using google.
This shows how to create a simple catalog that points to a local copy of the docbook DTD. First you need to download the DTDs, which there are links to in the references section below. I suggest placing them in a directory structure like:
xml\docbook\4.3\dtd <-- DTDs for docbook 4.3 in here
The DTDs are referenced in the xml files you are working with by a reference name, like for example:
-//OASIS//DTD DocBook XML V4.3//EN. The catalog mechanism works by mapping from this reference to a file on your disk.
Here is a simple catalog file containing a mapping for this DTD:
<?xml version="1.0"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <public publicId="-//OASIS//DTD DocBook XML V4.3//EN" uri="file:///c:/xml/docbook/4.3/dtd/docbookx.dtd"/> </catalog>
Note that you can also map previous versions of the requested DTD onto the newer version by mapping the old IDs to the new files.
Under Linux, xsltproc looks for a catalog in the default location of /etc/xml/catalog (or something similar). No alternative default is offered on Windows. Therefore, to point xsltproc at your catalog you must set the XML_CATALOG_FILES environment variable. This allows a space-separated list of filenames to be used.
From the command prompt:
you can also set this through the system properties control panel application. Once this is set, xsltproc will load your catalog file and use it to resolve the DTDs.
If you think this isn't working properly, you can view debug information relating to the use of the catalog by defining an environment variable like this:
You will now see lots more information about resolution when running xsltproc.
This post gives a bit of information about how to get the environment set up. I'll hopefully have time to write a bit about using all these tools as well in another pose.
1. Windows ports of xsltproc and required libraries: http://www.zlatkovic.com/libxml.en.html
1. Docbook Xml DTDs: http://www.docbook.org/xml/index.html
1. DocBook XSL Stylesheets: http://docbook.sourceforge.net/projects/xsl/
1. FOP: http://xml.apache.org/fop/
1. JAI: http://java.sun.com/products/java-media/jai/
It's clearly the day for non-software toys.
The SoundBridge from Roku is a network music player that plays from iTunes - it doesn't need any custom software of its own. It can work over wired or wireless networks and has a nice display:
The Roku can also be fed by the open source SlimServer music server. There are two models, one with a six inch display (the M1000, at around $250) and one with a massive twelve inch display that can display four lines of text (the M2000, around $500). Definitely cool toys.
Time for a new category, methinks. Still, we'll go for "cool stuff for the hard-at-work software developer" - it's almost cool software.
The Roomba Robotic Floor Vac from iRobot, another robot vacuum cleaner but at a low price point - and apparently it works! Today is clearly my day for discovering cool things that I wish I owned and can't afford. There's a new model out which can be pre-ordered: Roomba Discovery.
[via SilverOrange Stuff]
OK, so it's not cool software, but it is cool stuff for software developers:
the Lock Cup. This is a cup designed for those (such as my mate john) who find that no matter what cup/mug they bring to work some scoundrel half-inches it (or breaks it - but this cup doesn't fix that problem).
The Lock Cup has a key lock in the side; when the key is out, the cup doesn't hold water any more - genius!
YVG Software Services has a free tool that automatically imports album art for iTunes tracks, it's written in VB.NET and uses the iTunes COM for Windows SDK, talking to the Amazon Web Service - cool stuff! Even better, it seems to work!