alt text dropped in FO/PDF output of DocBook XML
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Wed Jul 26, 2017 6:48 pm
alt text dropped in FO/PDF output of DocBook XML
We include alt-text whenever we include images via "mediaobject"--this is a requirement for 508 compliance. Here is an example:
<mediaobject>
<alt>Department of Veteran's Affairs Logo</alt>
<imageobject>
<imagedata contentwidth="2in"
align="center"
fileref="images/va-logo.png"
format="png"/>
</imageobject>
</mediaobject>
However, the alt text entries are stripped in the resulting FO output despite running with <accessibility>true</accessibility> set in fo.conf. I doubt we're the first ones to encounter this issue--is there a parameter that needs to be set in order for alt text to be inserted into the resulting FO output?
<mediaobject>
<alt>Department of Veteran's Affairs Logo</alt>
<imageobject>
<imagedata contentwidth="2in"
align="center"
fileref="images/va-logo.png"
format="png"/>
</imageobject>
</mediaobject>
However, the alt text entries are stripped in the resulting FO output despite running with <accessibility>true</accessibility> set in fo.conf. I doubt we're the first ones to encounter this issue--is there a parameter that needs to be set in order for alt text to be inserted into the resulting FO output?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: alt text dropped in FO/PDF output of DocBook XML
Hi,
It seems that the default XSLT stylesheet provided by the Docbook project to convert Docbook to PDF does not use the <alt> element for anything.
I added an issue for it here:
https://github.com/docbook/xslt10-stylesheets/issues/62
if you want to try a manual XSLT fix, in the XSLT stylesheet:
OXYGEN_INSTALL_DIR\frameworks\docbook\xsl\fo\graphics.xsl
there is an xsl:if like:
After it you can add a:
Regards,
Radu
It seems that the default XSLT stylesheet provided by the Docbook project to convert Docbook to PDF does not use the <alt> element for anything.
I added an issue for it here:
https://github.com/docbook/xslt10-stylesheets/issues/62
if you want to try a manual XSLT fix, in the XSLT stylesheet:
OXYGEN_INSTALL_DIR\frameworks\docbook\xsl\fo\graphics.xsl
there is an xsl:if like:
Code: Select all
<xsl:if test="$align != ''">
<xsl:attribute name="text-align">
<xsl:value-of select="$align"/>
</xsl:attribute>
</xsl:if>
Code: Select all
<xsl:if test="parent::d:imageobject/preceding-sibling::d:alt">
<xsl:attribute name="alt-text" namespace="http://xmlgraphics.apache.org/fop/extensions">
<xsl:value-of select="parent::d:imageobject/preceding-sibling::d:alt"/>
</xsl:attribute>
</xsl:if>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service