OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] More roles at one section


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: jirka@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



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]