ToC in xslfo with same Topic multiple times Issue

123 views Asked by At

Happy New Year!

My dita map consists of sub maps with topics in it. If a topic occurs in multiple dita sub-maps, then in the ToC there is a page number and link referring to the first time the topic occurs in the document.

It is because of the ID of the topic. Wen creating page number (and link) in the toc it gets the ID. The topic occurs twice but as I understood with the same id. So when creating the link it is linked with the first occurence.

I will really appreciate your help.

1

There are 1 answers

3
DrMacro On BEST ANSWER

What version of the Open Toolkit are you using? This behavior is definitely a bug in that once the PDF processing has created the "merged" version of the map and topics the repeated copies of the topic should be given unique IDs--there's quite a bit of code in the PDF generation process to manage the assignment of unique IDs to topics (I know because I just broke some of it in a customization I'm currently working on).

Version 1.8 is the latest stable release, version 1.6.3 is the oldest release I would consider good to use (older versions will either have bugs that are fixed by 1.6.3 or lack good support for DITA 1.2 features).

Note that if you generate HTML from this same map you'll notice a similar behavior, namely that all the references to the topic in the generated HTML ToC will point to a single file--that is expected HTML behavior but makes sense since each topic generates a separate HTML file.

However, you can use the @copy-to attribute on the different topic refs to the topic to give the topic unique effective filenames for each reference (as though you had created literal copies of the topic and then referenced those copies). That should definitely solve your problem but shouldn't be necessary if all you want is the behavior you expected from the PDF, which should just work.

Cheers,

Eliot