Schematron Testing Framework poster

Inasmuch as it exists as a PDF file, you, too, can have your own copy of my “Schematron Testing Framework” (stf) poster from XML Prague 2012. I’m happy to say that I received constructive comments about stf from people at XML Prague 2012 who read the poster, and I’ll be looking at incorporating the feedback in the near future.

One suggestion, from George Bina, was to make a single “framework” file for running the tests – and including the test files in the framework file either directly or by using XInclude to refer to external test files – rather than the current decentralised approach. A single framework file would make it easier to make a report of the results, unlike the the current approach where the idea is that the only report you really want to see is “<errors/>” when there are no more errors. A single framework file could also become very large and hard to navigate when there’s lots of very similar tests in it. What do you think?

Schematron Testing Framework

Inasmuch as a suite of Schematron tests contains many contexts where a bug in a document will make a Schematron assert fail or a report succeed, it follows that for any new test suite and any reasonably sized but buggy document set, there will straight away be many assert and report messages produced by the tests. When that happens, how can you be sure your Schematron tests all worked as expected? How can you separate the expected results from the unexpected? What’s needed is a way to characterise the Schematron tests before you start as reporting only what they should, no more, and no less.

stf ( is a XProc pipeline that runs a Schematron test suite on test documents (that you create) and winnows out the expected results and report just the unexpected. stf uses a processing instruction (PI) in each of a set of (typically, small) test documents to indicate the test’s expected asserts and reports: the expected results are ignored, and all you see is what’s extra or missing. And when you have no more unexpected results from your test documents, you’re ready to use the Schematron on your real documents. Continue reading “Schematron Testing Framework”

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 (, 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 “CSS for the hierarchically minded”

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 “XML Summer School 2011 ends on high note”

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 “Developing and Testing 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 University, 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 “XML Summer School 2011”

XML Prague 2011 a success

Inasmuch as the EPUB: Chapter and Verse talk went down well and, for many people, the Saturday evening libations at The Strahov Monastic Brevery went down even better, I judge XML Prague 2011 to be a success for me (and for my co-author, Mark Howe) and for Mentea and also a success in its own right.

Several people made approving comments about the talk, which was good (some even commented on last year’s talk, which, since this showed they still remembered it, was even better). The best comment about this year’s though is probably @Innovimax‘s tweet:

Tony is a real 21th century XML Monk! He sponsored the Beer Station at #xmlprague and works on nicely printing bibles. #consideringJoining

Continue reading “XML Prague 2011 a success”