New XSL-FO 2.0 Working Draft

Inasmuch as that was always the plan, the XSL-FO 2.0 Working Draft published yesterday (latest version always at http://www.w3.org/TR/xslfo20/) is the first to incorporate new FOs and properties from the previous “Design Notes” document into the text from the XSL 1.1 Recommendation. The new WD also features more extensive linking from FO, property, and function references to their definitions. Continue reading

Posted in XSL

CSS for the hierarchically minded

Inasmuch as both HTML and XML markup – being descended from SGML – support a nested, hierarchical structure and as CSS allows, even promotes, a stream-of-consciousness style of coding, there can be a tension between the two approaches.

To put it another way:

  • If you want different styles in a couple of contexts that depend on the type of several levels of ancestor, then you get to put all those ancestors in the CSS selectors for each of those styles;
  • If you want to use the same colour in multiple different styles, then, by golly, you get to enter the same color value in each of them (and if you want to change it later, you get to find them all again to do it); and
  • If you want to use the same set of styles in multiple contexts – say, use rounded corners multiple places and with bigger radii on the outermost corners – then you get to repeat the same set of styles while jiggering their values every place that you want them.

The CSS soon gets to the point that only a machine can reliably work out the cascading and so we require tools such as Firebug to make sense of it and present it to us in ways that we can understand.

I have previously implemented a system for a client where the template CSS file is wrapped in an XML element and contains empty elements for each of the values of color properties so the all-XML processing system can ‘skin’ the stylesheet by substituting the preferred color values and outputting proper CSS on the way to making the HTML, but that was adding complexity, not taking it away.

Enter LESS (http://www.lesscss.org/), the “dynamic stylesheet language”. LESS is pretty much CSS as it should have been, since it elegantly solves the gripes listed above, and more besides. Continue reading

XML Summer School 2011 ends on high note

Inasmuch as my final “XSLT and XSL-FO toolbox of tips and tricks” session was well received, XML Summer School 2011 finished on a high note. My other sessions, “Developing and Testing in XSLT” with Jeni Tennison in the “XSLT/XQuery” track and a five-minute Ignite-format talk on EPUB, also went well, but it was that final talk in the “Publishing” track that got the most visible reactions. Continue reading

Business card, cubed

Inasmuch as I taught how to make an origami cube as one of the practicals when I did the “train the trainer” course, it occurred to me to do the same with my business cards.  It doesn’t hurt that the business cards have a large logo on the back:

Six business cards folded in a cube.

Here’s how: Continue reading

Saxon feature keys for initial template and mode

Inasmuch as a “feature key” is how you configure a Java JAXP XSLT processor, it’s good to see that Saxon 9.3 has added feature keys for setting the initial template and initial mode. In fact, Saxon has gone from 30 feature keys in Saxon 9.0 to 70 in 9.2 and now 79 in 9.3.

Where this becomes useful (outside of your own Java programs) is being able to specify the initial template and/or mode in the <xslt> task in Ant build files. Continue reading

X11 connection rejected because of wrong authentication

Inasmuch as using a frame from Emacs running on the laptop on the larger screen of the desktop machine using `make-frame-on-display' is one of life’s pleasures, it was less than a pleasure when it stopped working with a “X11 connection rejected because of wrong authentication” message after an upgrade of one of the machines.

Several upgrades and much thrashing later, the solution by Gregory Grubbs at http://gregorygrubbs.com/development/get-remote-x-working-in-karmic/ works for me, and the script in the fifth comment by Ben Hyde for running emacsclient makes things even easier than I was used to. Continue reading

Debugging FOP process

Inasmuch as I sometimes want to debug (an extended version of) FOP “in place” and without too much setup, I can use this command line to suspend FOP on startup until I attach the debugger:

FOP_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=9000,server=y,suspend=y" fop test.fo test.pdf

XML Summer School 2011

Inasmuch as I was already asked to be on the Publishing track at XML Summer School 2011, I was then invited to co-teach “Devel­op­ing and Test­ing in XSLT” with Jeni Tennison in the XSLT and XQuery track, so I’m pleased that I’ll be teaching two sessions at the XML Summer School in St Edmund Hall, Oxford Uni­ver­sity, on 18-23 September 2011. (Early bird discount ends 30 June 2011.)

My sessions are but 1/4 of their respective tracks, but I’ll be in the room for the entirety of each track and, indeed, like all Faculty at the XML Summer School, I’ll be around all week. Continue reading

Converting RNG to RNC

Inasmuch as the customised version of the “xmlspec” schema being used for the next version of the XSL spec is maintained in RELAX NG XML syntax (RNG) and Emacs’s nXML-mode only uses RELAX NG compact syntax (RNC), I yet again wanted to convert a schema from RNG to RNC.  As you would expect, there’s more than one way to do it. Continue reading