If you have an image (e. g. <inlinegraphic> or <inlinemediaobject><imageobject></imageobject></inlinemediaobject>) as part of the <title> of a <figure> but without an alt-text defined (<textobject><phrase/></textobject> in the same <inlinemediaobject>), the html stylesheets fall into a recursive look trap, as the title of the figure is tried to be used as alt-text.<br> At least with Xalan-J this results in a StackOverflowError.</p> <p>The following DocBook file reproduces the problem and the attached patch fixes the recursion by not using an alt text in that case.</p> <div class="codehilite"><pre><span></span><code><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span> <span class="cp"><!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"></span> <span class="nt"><article></span> <span class="w"> </span><span class="nt"><figure></span> <span class="w"> </span><span class="nt"><title><inlinegraphic</span><span class="w"> </span><span class="na">fileref=</span><span class="s">"images/pdf.png"</span><span class="nt">/></title></span> <span class="w"> </span><span class="nt"><beginpage/></span> <span class="w"> </span><span class="nt"></figure></span> <span class="nt"></article></span> </code></pre></div> </title></inlinegraphic>
Let's try this again. It seems most of my text was swallowed and there is no edit button as far as I can see:
If you have an image (e. g.
<inlinegraphic/>or<inlinemediaobject><imageobject/></inlinemediaobject>) as part of the<title>of a<figure>but without an alt-text defined (<textobject><phrase/></textobject>in the same<inlinemediaobject>), the html stylesheets fall into a recursive loop trap, as the title of the figure is tried to be used as alt-text.At least with Xalan-J this results in a StackOverflowError.
The following DocBook file reproduces the problem and the attached patch fixes the recursion by not using an alt text in that case.
Last edit: Björn Kautler 2016-03-20