Exclude some indexes from topic numbering

Post here questions and problems related to editing and publishing DITA content.
Yuriy_1977
Posts: 8
Joined: Thu Jan 20, 2022 8:05 am

Exclude some indexes from topic numbering

Post by Yuriy_1977 »

I use:
*.ditamap
transformation scenario - "DITA Map PDF - based on XSL-FO",
For numbering topics, I use "generate numbers before the topic's title" plugin from raducoravu.
I use custom.xsl against css.

I need to exclude some Cyrillic indexes from my topic numbering (I use xml:lang="ru" in my topics ).
For example - I don't need letters "Ъ" and "З".
I am using the following count in the file plugins\org.dita.pdf2\xsl\fo\topic.xsl (some template's part):

Code: Select all

                    <xsl:number
                        count="*[contains(@class, ' map/topicref ') and starts-with(topicmeta/navtitle/text(), 'Приложение')]"
                        format="А"/> 
where format="А" - Cyrillic.

In the plugins\org.dita.pdf2\cfg\common\index\ru.xml I exclude letters "Ъ" and "З" (their <index.group>) but it doen't work: letters are present in the numbering of my PDF file.
It looks like the file is not used when generating the PDF.

Need help, advice :D .
Thanks in advance.
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Exclude some indexes from topic numbering

Post by julien_lacour »

Hello,

The characters from org.dita.pdf2\cfg\common\index\ru.xml are only used for numbering indexterms, they are not used elsewhere.
A possible solution is to define a list of allowed characters and take the character matching the current topic position from the list:

Code: Select all

<!-- Define a variable with allowed characters -->   
<xsl:variable name="chars" select="'АБВГДЕЖИКЛМНОПРССУФХЦЧШЩЫЭЮЯАААБАВАГ'"/>
...
<xsl:value-of select="concat(substring($chars, position(), 1), ') ')"/>
Regards,
Julien
Yuriy_1977
Posts: 8
Joined: Thu Jan 20, 2022 8:05 am

Re: Exclude some indexes from topic numbering

Post by Yuriy_1977 »

Thanks a lot i will try your way
Post Reply