Creating subtitles on first page from ditamap

Bob.Conlin
Posts: 22
Joined: Sun Aug 14, 2011 5:21 am

Creating subtitles on first page from ditamap

Post by Bob.Conlin » Wed Oct 19, 2011 12:50 am

Using a Bookmap with a <booktitlealt> I can create a subtitle on the title page of the PDF render, no problem. Now I want to the do the same thing from a ditamap. In front-matter_1.0.xsl I tried:

Code: Select all

<xsl:apply-templates select="//*[contains(@class,' map/map ')][1]/*[contains(@class,' map/topicmeta/searchtitle ')]/*[contains(@class,' topicmeta/searchtitle ')]"/>
and

Code: Select all

<xsl:value-of select="//*[contains(@class, ' map/map ')]/@topicmeta/searchtitle"/>
Searchtitle is just a starting point. I actually want to use prodinfo/prodname elements that will match the product attributes that I use for conditional profiling. I intend to model a fo:block similar to the previous section of front-matter_1.0.xsl for __frontmatter_title. I also need publisher information on the title page.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: Creating subtitles on first page from ditamap

Post by Radu » Thu Oct 20, 2011 5:34 pm

Hi Bob,

The <searchtitle> has a DITA class like - map/searchtitle and in your example you are matching it using something like contains(@class,' topicmeta/searchtitle ' so this might be a problem.

So in the front-matter_1.0.xsl there is an apply templates like:

Code: Select all

<fo:block xsl:use-attribute-sets="__frontmatter__owner">
<xsl:apply-templates select="$map//*[contains(@class,' bookmap/bookmeta ')]"/>
</fo:block>
after it you can add the following code:

Code: Select all

 <fo:block xsl:use-attribute-sets="__frontmatter__owner">
<xsl:apply-templates select="$map/*[contains(@class,' map/topicmeta')]"/>
</fo:block>
then add two more templates to the XSL:

Code: Select all

 <xsl:template match="*[contains(@class, ' map/topicmeta ')]">
<fo:block-container xsl:use-attribute-sets="__frontmatter__owner__container">
<fo:block >
<xsl:apply-templates/>
</fo:block>
</fo:block-container>
</xsl:template>


<xsl:template match="*[contains(@class,' map/searchtitle ')]" priority="+2">
<fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Bob.Conlin
Posts: 22
Joined: Sun Aug 14, 2011 5:21 am

Re: Creating subtitles on first page from ditamap

Post by Bob.Conlin » Thu Oct 20, 2011 11:46 pm

Thanks Radu,

I had one bit of trouble. In front-matter-attr.xsl in
<xsl:attribute-set name="__frontmatter__owner__container">
the top attribute was set to 210, effectively pushing the content off the page. I set it to 20 and there my content was. All better.

Bob

Post Reply