Hi David,
Am Dienstag, 29. Oktober 2013, 11:52:20 schrieb David Goss:
> I have the the following docbook 5 markup:
> <para>Click the
> <guibutton><inlinemediaobject><alt>Execute</alt><imageobject><imagedata
> fileref="img/ldms/ldms_button_execute.png"
> depth="1em"/></imageobject></inlinemediaobject> button.</guibutton></para>
>
> It is outputting the following HTML :
> <p>Click the <span class="guibutton"><span class="inlinemediaobject"><img
> src="img/ldms/ldms_button_execute.png" height="13"></span></span>
> button.</p>
>
> I'm not sure why the alt text is not carrying over. Am I using the alt tag
> incorrectly or is this a bug? I'm using webhelp docbook-xsl-ns-1.78.1 .
Your DocBook markup is perfectly correct. But it seems, there is a deficiancy
about the handling of inlinemediaobject in the DocBook stylesheets.
I suspect the html/graphics.xsl file in the "imagedata" template (lines 1250 -
1331). In this template rule, the "process.image" template is called and the
"alt" parameter is passed. However, it is not checked against an
inlinemediaobject with a possible alt element.
I would propose this change:
<xsl:call-template name="process.image">
<xsl:with-param name="alt">
<xsl:choose>
<xsl:when test="ancestor::mediaobject/alt">
<xsl:apply-templates select="ancestor::mediaobject/alt"/>
</xsl:when>
<xsl:when test="ancestor::inlinemediaobject/alt">
<xsl:apply-templates select="ancestor::inlinemediaobject/alt"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates
select="$phrases[not(@role) or @role!='tex'][1]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="longdesc">
<xsl:call-template name="write.longdesc">
<xsl:with-param name="mediaobject"
select="ancestor::imageobject/parent::*"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
If you would like to give it a try, do the following:
1. Create a customization layer if you haven't done yet. If you don't know
how, read one of the following URLs:
http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer
http://doccookbook.sf.net/html/en/dbc.common.dbcustomize.html
2. Copy the "imagedata" template from the original html/graphics.xsl template
into your customization layer.
3. Search for the xsl:call-template line and apply the above "patch" (add the
2nd xsl:when test).
4. Transform your DocBook document and use your customization layer.
> I did see this page in the XSL Guide:
> http://www.sagehill.net/docbookxsl/AltText.html
> But it looks to be for Docbook4.
You can use this also in DocBook 5 as long as it is valid.
--
Gruß/Regards
Thomas Schraitle
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]