On 14.6.2020 9:26, Pavel Vávra wrote:
>   I need to hide some sections from TOC. It can be solved by assigning a role 
> to section, eg. role hideTOC. I need to print some sections together on one 
> page, which is now done by another role NoPgBreak (see my previous question).
>   Now I need to combine both roles at one section. Is it possible by 
> combining these roles? How to test it in xsl? I have an idea thet i set role 
> "NoPgBreak, hideTOC" and then I test if role *contains string* 'hideTOC' 
> instead *it is equal* to 'hideTOC' and vice versa. Is it possible in xsl 
> language? Searching in tutorials at web didn't bring me answer.

Indeed, it's definitively possible in XSLT. Unfortunatelly stylesheets
you are using are written in XSLT 1.0 where such easy comparision must
be written in a rather awkward way (it would be much easier to do this
in XSLT 2.0/3.0).

Separate values in role attribute by spaces, e.g.

<section role="hideToc NoPgBreak">

Then in conditions use something like

<xsl:if test="contains(concat(' ', @role, ' '), ' hideToc ')">

Be careful about spaces above. They make sure that tokens in role
atttribute can be even substring of each other and condition will still
work properly.

-- 
------------------------------------------------------------------
  Jirka Kosek     e-mail: ji...@kosek.cz     http://www.kosek.cz
------------------------------------------------------------------
  Profesionální školení a poradenství v oblasti technologií XML.
       Podrobný přehled školení http://xmlguru.cz/skoleni/
------------------------------------------------------------------
  http://docbook.cz    Stránky o dokumentačním formátu DocBook
  http://xmlguru.cz    Blog mostly about XML for English readers
------------------------------------------------------------------

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to