Another snapshot of the continuing improvements to the XSLT 2.0 stylesheets for DocBook.

Yesterday, I quietly published the 2.0.3 release of the DocBook XSLT 2.0 stylesheets.

The big change in this release is the move towards HTML5. The stylesheets now produce <article> elements for major units, <section> elements for sections, <figure> elements, etc. In order to retain compatibility with older browsers, I've updated the CSS and JavaScript. I'm employing a customized version of Modernizr for backwards compatibility.

I've updated the stylesheets used for this weblog to the latest release and flushed all the cached HTML, so those changes appear here now as well. If you see any weirdness, please report it.

Other changes worth noting: table columns now have a class attribute for better CSS access and tables of contents are always (and only) produced with <ul>’s. The alternative presentation with <dl> produced invalid markup because there were never any <dd>s.

The other changes are summarized in the release notes:

Share and enjoy!

Comments:

It'd be interesting to see a couple of sample documents published using the old stylesheets and the new release just to compare the markup.

Posted by Keith Fahlgren on 01 Dec 2011 @ 06:18pm UTC #

Good point. See this gist.

Posted by Norman Walsh on 01 Dec 2011 @ 07:05pm UTC #

Are the website stylesheets getting to 'production' standard yet Norm? Thinking of moving the docbook faq over to them?

Posted by Dave Pawson on 01 Dec 2011 @ 07:09pm UTC #

I'm using them in production. For what it's worth.

Posted by Norman Walsh on 02 Dec 2011 @ 12:57pm UTC #

Hi there,

I was having a problem transforming documents(I tried two) using SaxonHE9-4-0-2J:

Error on line 71 of xlink.xsl:
  XPTY0004: A sequence of more than one item is not allowed as the first argument of
  generate-id() (, ) 
  at xsl:apply-templates (file:////.../.../docbook-xslt2-2.0.3/xslt/base/html/chunktemp.xsl#79)
     processing /book/chapter[2]

I fixed it by changing line 58 of xlink.xsl:


<xsl:variable name="para" select="ancestor::db:para[1]"/>

From there it worked fine.

I noticed that the problem isn't there for saxonhe9-2-1-5j

Having HTML5 is just great, hope this helps

Posted by Maxime Bégnis on 01 Feb 2012 @ 10:34am UTC #

Hi there,

I was having a problem transforming documents(I tried two) using SaxonHE9-4-0-2J:

Error on line 71 of xlink.xsl:
  XPTY0004: A sequence of more than one item is not allowed as the first argument of
  generate-id() (, ) 
  at xsl:apply-templates (file:////.../.../docbook-xslt2-2.0.3/xslt/base/html/chunktemp.xsl#79)
     processing /book/chapter[2]

I fixed it by changing line 58 of xlink.xsl:

<!-- Taking only the first para -->
<xsl:variable name="para" select="ancestor::db:para[1]"/>

From there it worked fine.

I noticed that the problem isn't there for saxonhe9-2-1-5j

Having HTML5 is just great, hope this helps

Posted by Maxime Bégnis on 01 Feb 2012 @ 01:13pm UTC #

Hi,

Thanks for the error report; could you please open an issue at github and include a sample document that demonstrates the problem.

I think you're right, but I'd like to have a document for the test suite.

Posted by Norman Walsh on 01 Feb 2012 @ 01:24pm UTC #

I just found out that the problem comes from itemized lists wrapped in paragraphs...

https://github.com/docbook/xslt20-stylesheets/issues/6

I didn't find a way to attach a file to the issue, sorry for the big paste.

Posted by Maxime Bégnis on 01 Feb 2012 @ 02:51pm UTC #

Thanks. I'll take a look asap.

Posted by Norman Walsh on 01 Feb 2012 @ 03:38pm UTC #
Add a comment or subscribe to (existing and future) comments on this essay.
Name:
Email*:
 *Please provide your real email address; it will not be displayed as part of the comment.
Homepage:
Comment**:
 **The following markup may be used in the body of the comment: a, abbr, b, br, code, em, i, p, pre, strong, and var. You can also use character entities. Any other markup will be discarded, including all attributes (except href on a). Your tag soup will be sanitized...