so

DocBook XSLT 2.0 Stylesheets

Volume 3, Issue 17; 13 Sep 2019

A new release of the DocBook XSLT 2.0 Stylesheets is available. The primary motivation was to improve Saxon 9.9 support.

Yesterday, I pushed version 2.3.14 of the DocBook XSLT 2.0 Stylesheets. (I also pushed them to Maven if you prefer not to construct your class paths by hand.)

One of the difficulties with having an interest in many open source projects is finding the time to give them all the attention they deserve. I still plan to come back and improve the paged media output from the XSLT 2.0 stylesheets. And maybe even convert them to XSLT 3.0 at some point, but XProc 3.0 is getting most of my attention these days.

That said, DocBook is used both for the XProc specifications and also for my XML Summer School slides. And since I started using (some recent version of?) Saxon 9.9, I’ve been getting loads of err:SXWN9000 warnings.

That warning is about the use of xsl:value-of to return atomic values. Consider:

<xsl:function name="ex:give-me-five" as="xs:integer">
  <xsl:value-of select="5"/>
</xsl:function>

Technically, xsl:value-of returns a text node, so it’s a bit bogus to use it to return atomic values. You should use xsl:sequence instead. But there’s a long history of using xsl:value-of (it predates xsl:sequence by a decade or two!) and it took a couple of tries (and finally an XSLT stylesheet) to find and remove them all.

Along the way, I also:

  1. Added support for the other style in keycap. It’s not interesting or useful, but avoids an error in the test suite.
  2. Cleaned up a bunch of whitespace inconsistencies (spaces vs. tabs, linebreaks, etc.).
  3. Tinkered with the jar file manifest to make it easier to use directly on the classpath (as opposed to through Maven).
  4. Updated the Travis build to use OpenJDK8. Something more recent might be better, but this avoids class file compatibility problems for the time being.
  5. Updated the build infrastructure (version of Gradle)

Share and enjoy.

Web mentions

Comments

Thanks Norm. I'll give it a try. (When I've installed 9.9!)

—Posted by Dave Pawson on 13 Sep 2019 @ 09:58 UTC #

To clarify: Saxon 9.9 isn't required. This release just fixes a bunch of warning messages that you would have received if you used the previous release with Saxon 9.9.

Please provide your name and email address. Your email address will not be displayed and I won’t spam you, I promise. Your name and a link to your web address, if you provide one, will be displayed.

Your name:

Your email:

Homepage:

Do you comprehend the words on this page? (Please demonstrate that you aren't a mindless, screen-scraping robot.)

What is ten minus four?  (e.g. six plus two is 8)

Enter your comment in the box below. You may style your comment with the CommonMark flavor of Markdown.

All comments are moderated. I don’t promise to preserve all of your formatting and I reserve the right to remove comments for any reason.