seq = seq + 1
end
+# Disabled as dblatex do not understand chapter/chapterinfo/author,
+# see <URL: https://bugs.debian.org/891183 >.
+if false
+log 0, 'migrate chapter author into <chapterinfo> where relevant'
+xml.css('chapter para').each do |para|
+ if para.content =~ /^\s*((Paul|Sarah Hinchliff) (Stacey|Pearson))\s*$/
+ log 1, 'migrated %s %s' % [$2, $3]
+ para.parent.css('title')[0].before(<<'XML' % [$2, $3])
+ <chapterinfo>
+ <author>
+ <firstname>%s</firstname><surname>%s</surname>
+ </author>
+ </chapterinfo>
+XML
+ para.remove
+ end
+end
+end
+
log 0, 'Writing processed file'
# Unable to figure out API way to replace DOCTYPE
data = xml.to_xml().gsub!(/DOCTYPE article/, 'DOCTYPE book')