This invalidates the translations, but ensure docbook control the look
of references.
end
end
+log 0, 'replace "Fig. \#." with docbook figure xref'
+xml.css("para").each do |para|
+ xml_text = para.to_xml(:skip_instruct => true).to_s
+ xml_text.gsub!(/Fig\.\s+(\d)\.?/,
+ 'Fig. <xref xrefstyle="template:%n" linkend="fig-\\1"/>')
+ para.after(xml_text)
+ para.remove
+end
+
log 0, 'Writing processed file'
# Unable to figure out API way to replace DOCTYPE
data = xml.to_xml().gsub!(/DOCTYPE article/, 'DOCTYPE book')