How to set a specific attribute set for specific titles in DITA-OT's PDF2 Plugin?

StackOverflow https://stackoverflow.com/questions/11546106

  •  21-06-2021
  •  | 
  •  

Domanda

I'm struggling a bit with a customization to the OT's PDF2 plugin (using FOP). What I'd like to do is use a custom attribute set for all topic titles that have a certain value for @outputclass. I've successfully defined the custom attribute set. But I'm not sure as to the correct template to write, because the one I have written breaks the PDF file's bookmarks. This is what I have in custom.xsl:

<xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')][@outputclass='drilltitle']">
<fo:block xsl:use-attribute-sets="hkdrill.title">
    <xsl:apply-templates/>
</fo:block>
</xsl:template>   

Any help would be much appreciated.

Thanks, Steven

È stato utile?

Soluzione

How about something like this:

<xsl:template match="*[@outputclass='drilltitle']" mode="processTopicTitle">
  <fo:wrapper xsl:use-attribute-sets="hkdrill.title">
    <xsl:next-match/>
  </fo:wrapper>
</xsl:template>

This will work if the attributes you add are not set by the normal topic title attribute-sets. If you need to override the same attribute as in the built-in attribute-sets, you need to create a copy of the template in processTopicTitle mode and make your changes there. The reason for that is that PDF2 stylesheets use their own "attribute-set reflection" that doesn't allow combining attribute sets in a normal way.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top