Can you add conref content to index.html file?

Here should go questions about transforming XML with XSLT and FOP.
Posts: 34
Joined: Tue Oct 15, 2013 11:35 pm

Can you add conref content to index.html file?

Post by BobbyG66 » Tue Jun 30, 2015 3:29 pm

We have modified our DITA-OT to output the index.html file with custom metadata tags.
This is working fine, but now we want to add content from a conref source, but not getting the output we want.

We modified this file (/DITA_OT1.7.5/xsl/map2htmtoc/map2mtmtocimpl.xsl) by adding this code:

Code: Select all

  <xsl:template name="generateBookMeta">
<xsl:value-of select="//*[contains(@class,' bookmap/mainbooktitle ')]"/>
</mainbooktitle><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/booktitlealt ')]"/>
</booktitlealt><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/booklibrary ')]"/>
</booklibrary><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/bookpartno ')]"/>
</bookpartno><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/revisionid ')]"/>
</revision><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/month ')]"/>
</month><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/year ')]"/>
</year><xsl:value-of select="$newline"/>
<xsl:value-of select="//*[contains(@class,' bookmap/trademarklist ')]"/>
</trademarklist><xsl:value-of select="$newline"/>
All of the bookmetadata is text only and outputs fine.
The final entry is for a list of trademarks and points to a conref source.
The output we are getting is the title twice, then all of the other bookmetadata.

The trademark list is in the frontmatter section.
Any ideas on how to pull in the actual content from the conref source?


Posts: 7273
Joined: Fri Jul 09, 2004 5:18 pm

Re: Can you add conref content to index.html file?

Post by Radu » Tue Jun 30, 2015 4:45 pm

Hi Bob,

I'm not entirely sure how your DITA content looks like so if my answer below does not help, you can contact us directly to and give us a small sample DITA project and we'll try to find some time to look into them.

First of all you should try to see the actual XML content on which your template is applied.
So at the beginning of your template you should try to add an xsl:message like:

Code: Select all

        <xsl:message>ENTIRE CONTENT:
<xsl:copy-of select="/*"/></xsl:message>
After you run the transformation you should find that message in the received ANT console output.

This will help you see how that trademarklist looks like in the content over which the XSLT is applied.

Possibly instead of:

Code: Select all

<xsl:value-of select="//*[contains(@class,' bookmap/trademarklist ')]"/>
you will need to do something like:

Code: Select all

        <xsl:apply-templates select="(//*[contains(@class,' bookmap/trademarklist ')])[1]"/>
Radu Coravu
<oXygen/> XML Editor

Post Reply