Hi Eric, On Fri, 5 Apr 2013 01:00:45 +0000 Eric Nordlund <nordl...@cray.com> wrote:
> [... @id attributes in titles instead of parent...] > > Is there a way to make these work in the XSL-FO output? I was > thinking I could have a template that could recognize when an > xref/@linkend pointed to the id of a title and then change the > linkend to the id of the title's parent element, but I don't really > know how to do that. > > Is there another way to do what I need to do? Well, my impression was that the DocBook XSL stylesheets takes this into account, so in theory it doesn't matter if the @id was placed wrongly. Maybe I'm wrong, I haven't tested that. However, if you really care, I would target your issue from a different angle: use XSLT to move your @id attribute to its parent element. Pass the result to your DocBook stylesheets (or your customization layer). No FO customization is needed in this case. :) Here is a stylesheet that moves an @id attribute from a title element to its parent element (probably it's incomplete, but it should be easy to extent it): --------------------------------- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes" doctype-public="-//OASIS//DTD DocBook XML V4.5//EN" doctype-system="http://www.docbook.org/xml/4.5/docbookx.dtd"/> <xsl:template match="node() | @*" name="copy"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="title/@id"/> <xsl:template name="copytitleid"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:if test="(title/@id| *[contains(local-name(),'info')]/title/@id)"> <xsl:attribute name="id"> <xsl:value-of select="(title/@id| *[contains(local-name(),'info')]/title/@id)[1]"/> </xsl:attribute> </xsl:if> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="appendix|article|book| bibliography|bibliodiv| chapter|colophon| dedication|glossary| preface|part|reference| refsection|refsect1|refsect2|refsect3| set| section|sect1|sect2|sect3|sect4|sect5"> <xsl:call-template name="copytitleid"/> </xsl:template> <xsl:template match="figure|example|procedure|task"> <xsl:call-template name="copytitleid"/> </xsl:template> </xsl:stylesheet> --------------------------------- -- Gruß/Regards, Thomas Schraitle --------------------------------------------------------------------- To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
