Unique images

22 views
Skip to first unread message

Stefan Eike

unread,
Apr 5, 2022, 10:45:54 AM4/5/22
to DITA-OT Users
Hi,

We have multiple languages per deliverable and I don't want to repeat images. So, I'm extracting the images from the topics during the publication and moving them to a special list type in <booklist>. This works. The original image is replaced with a cross reference.

What I cannot do is that I cannot find out how to repeat an image multiple times. So, the special list contains all the images from the English topics and again from the German topics and so forth. To avoid this, I need to determine if an image was already processed. Has somebody solved this problem already?

Thanks a lot in advance

Radu Coravu

unread,
Apr 6, 2022, 2:10:45 AM4/6/22
to Stefan Eike, DITA-OT Users
Hi Stefan,

Are you doing this extraction using XSLT? Is this a question about how you could use XSLT to minimize the set of image references obtained using an XPath? How does that XSLT look like?

Regards,
Radu

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/3a064b16-01cb-44b7-a0a3-c113728ba570n%40googlegroups.com.

Stefan Eike

unread,
Apr 6, 2022, 8:04:14 AM4/6/22
to DITA-OT Users
Hi Radu,

Yes, this is implemented in XSLT. I have built this based on the lot-lof principle. Instead of creating a list of figure references, I create a list of figures. I'm attaching the XSL stylesheet. I could also share the plugin by e-mail or direct link to the repository.
figure-container.xsl

Radu Coravu

unread,
Apr 7, 2022, 1:16:00 AM4/7/22
to Stefan Eike, DITA-OT Users
Hi Stefan,

Maybe when you apply the template you could add some kind of extra condition to skip over figures which contain images pointing to the same @href which has been referenced somewhere else, but I have not tested this:

                        <xsl:apply-templates select="//*[contains (@class, ' topic/fig ')]
                            [not(image/@href=preceding-sibling::image[@href]/@href)]
                            [child::*[contains(@class, ' topic/title ' )]]
                            [dita-ot:notExcludedByDraftElement(.)]"
                            mode="list.of.figures"/>

Regards,
Radu

Reply all
Reply to author
Forward
0 new messages