[jats-list] JPub3 Preview Stylesheets generating invalid XHTML

Subject: [jats-list] JPub3 Preview Stylesheets generating invalid XHTML
From: Gerry King <g.king@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 06 Dec 2012 16:17:11 +0000
<newbie alert /> I hadn't seen Wendell Piez's article on Fitting the Journal Publishing 3.0 Preview Stylesheets to your needs (http://www.ncbi.nlm.nih.gov/books/NBK47104/#piez-pipelining-methods) when I started my descent into hell however I don't think it would have provided a solution...

Using the preview XSLT pipeline and then adding one last transform to create the desired xhtml fragment seemed easy enough. I thought I had it working.

Unfortunately I had forgotten about the warnings from TextMate+HTMLTidy and spent the past week chasing my tail trying to work out why my XSL worked on a sample XHTML that had been tidied but failed to generate the desired output when I tried a batch <sigh>

I was surprised that the output from jpub3-PMCcit-xhtml.xsl is invalid (my original sample has 104 errors according to http://validator.w3.org/check). The source of my woes are <a href>s that have name attributes but not id's; my XSL uses these in key()s.

<xsl:key name="figslist" match="//div[@class='fig panel']" use="concat('#', a[1]/@id)"/>
<xsl:key name="tableslist" match="//div[starts-with(@class, 'table-wrap')]" use="concat('#', a[1]/@id)"/>

Fixing the problem in the jpub3-PMCcit-xhtml.xsl pipeline is daunting so I guess I will use a Python script and pass the xhtml through HTMLTidy before running my XSL for now.

I am surprised nobody else has had issues with the xhtml output before (searching this list before posting didn't find any hits). Are there any plans to make the tool generate valid xhtml?

Gerry King
Spandidos Publications

Current Thread