Can you add conref content to index.html file?

Here should go questions about transforming XML with XSLT and FOP.
BobbyG66
Posts: 26

Can you add conref content to index.html file?

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">
    <mainbooktitle>
      <xsl:value-of select="//*[contains(@class,' bookmap/mainbooktitle ')]"/>
   </mainbooktitle><xsl:value-of select="$newline"/>
   <booktitlealt>
      <xsl:value-of select="//*[contains(@class,' bookmap/booktitlealt ')]"/>
   </booktitlealt><xsl:value-of select="$newline"/>
   <booklibrary>
      <xsl:value-of select="//*[contains(@class,' bookmap/booklibrary ')]"/>
   </booklibrary><xsl:value-of select="$newline"/>
     <bookpartno>
    <xsl:value-of select="//*[contains(@class,' bookmap/bookpartno ')]"/>
   </bookpartno><xsl:value-of select="$newline"/>
   <revision>
      <xsl:value-of select="//*[contains(@class,' bookmap/revisionid ')]"/>
   </revision><xsl:value-of select="$newline"/>
   <month>
      <xsl:value-of select="//*[contains(@class,' bookmap/month ')]"/>
   </month><xsl:value-of select="$newline"/>
   <year>
      <xsl:value-of select="//*[contains(@class,' bookmap/year ')]"/>
   </year><xsl:value-of select="$newline"/>
   <trademarklist>
      <xsl:value-of select="//*[contains(@class,' bookmap/trademarklist ')]"/>
   </trademarklist><xsl:value-of select="$newline"/>
</xsl:template>


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?

Thanks
Bob
Radu
Posts: 5386

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

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 support@oxygenxml.com 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]"/>


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

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest