Page 1 of 1

DITA-OT with PDF with XEP indices

Posted: Mon Jan 23, 2017 6:08 pm
by SimonH
I've got an issue with the index ouput.

I have a topic which defines:

<indexterm>frequency plot</indexterm>

and another that defines:

<indexterm>frequency plot<indexterm>grouped</indexterm></indexterm>

The generated output is:

frequency plot 70–71, 97
grouped 97

Basically the grouped frequency plot page numbers are output for the parent index term too. I saw a method of omitting the page numbers from the parent term using <xsl:with-param name="no-page">true</xsl:with-param> in the index_xep.xsl. However, this excludes all references on the parent term. I just wanted to exclude the page number for the term that is a descendent (page 97).

Anyone have any ideas how to omit the page numbers for the nested term? I presume these are been built somewhere higher up the chain.

Re: DITA-OT with PDF with XEP indices

Posted: Tue Jan 24, 2017 9:44 am
by Radu
Hi,

I created a small sample DITA project based on your suggestions, set the "clean.temp" parameter to "no" in the transformation scenario and published to PDF using XEP.
Then I opened the "topic.fo" file from the transformation temporary files folder.
I searched in it for the frequency plot: index term. At the end of the FO file where the index page is built, there is a reference like this:

Code: Select all

<fo:index-page-citation-list>
<fo:index-key-reference color="blue" font-style="italic"
page-number-treatment="link" ref-index-key="frequency plot:"/>
</fo:index-page-citation-list>
so the enumerated list of pages is built by XEP by looking in all places where the index key "frequency plot:" is defined.
In my original DITA topic I had an index term like this:

Code: Select all

<cmd>Remove the<indexterm>frequency plot<indexterm>grouped</indexterm></indexterm> old oil filter.</cmd>
which got converted in the topic.fo to something like this:

Code: Select all

<fo:block>Remove the<fo:inline index-key="frequency plot:"/><fo:inline
index-key="frequency plot:grouped:"/> old oil filter.</fo:block>
So an index key is defined for the "frequency plot:" even though it is generated from a parent index term.
In the XSLT stylesheet DITA-OT-DIR\plugins\org.dita.pdf2\xsl\fo\index.xsl there is a template which creates all these inline index-key definitions:

Code: Select all

  <xsl:template match="opentopic-index:index.entry">
<xsl:for-each select="opentopic-index:refID[last()]">
<fo:inline index-key="{@value}"/>
</xsl:for-each>
<xsl:apply-templates/>
</xsl:template>
Maybe you could change that template to avoid generating key definitions for index entries which have child index entries, something like this:

Code: Select all

  <xsl:template match="opentopic-index:index.entry">
<xsl:if test="not(opentopic-index:index.entry)">
<xsl:for-each select="opentopic-index:refID[last()]">
<fo:inline index-key="{@value}"/>
</xsl:for-each>
</xsl:if>
<xsl:apply-templates/>
</xsl:template>
By the way, this recent DITA OT 2.x fix adds proper indentation for the nested index term:

https://github.com/dita-ot/dita-ot/issues/1525

Regards,
Radu

Re: DITA-OT with PDF with XEP indices

Posted: Tue Jan 24, 2017 2:15 pm
by SimonH
Thanks as ever. I will give it a try.

Re: DITA-OT with PDF with XEP indices

Posted: Wed Apr 04, 2018 12:31 pm
by ckabstein
Hi Radu,

I have the same "issue", tried out your suggestion, but we are currently evaluating Antenna House - and Antenna House seems to not like it.
It seems that the parent entries cannot be resolved properly. The error that is returned is 'Unresolved index-key value: "frequency plot:"'
Interestingly, the PDF output shows the wanted result.

Any ideas how this could be done differently? If not, I'm going to ask in the DITA user group.

Thanks and regards,
Christina

Re: DITA-OT with PDF with XEP indices

Posted: Tue Apr 10, 2018 10:02 am
by Radu
Hi Christina,

Sorry for the delay, you did well to write about this on the DITA Users List, there are people from Antenna House registered on it.
If you do not get an answer for it please update this forum thread and I'll try to get someone from Antenna House answer it. From what I know Antenna House also has a special DITA OT PDF plugin so they might want you to consider using it to produce the PDF as it works better with their engine.

Regards,
Radu