Page 1 of 1

Creating subtitles on first page from ditamap

Posted: Wed Oct 19, 2011 12:50 am
by Bob.Conlin
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.

Re: Creating subtitles on first page from ditamap

Posted: Thu Oct 20, 2011 5:34 pm
by Radu
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

Re: Creating subtitles on first page from ditamap

Posted: Thu Oct 20, 2011 11:46 pm
by Bob.Conlin
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