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

2020-06-16 Thread Jirka Kosek
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.



Then in conditions use something like



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.czStránky o dokumentačním formátu DocBook
  http://xmlguru.czBlog mostly about XML for English readers
--



smime.p7s
Description: S/MIME Cryptographic Signature


[docbook-apps] More roles at one section

2020-06-14 Thread Pavel Vávra
Hi,
  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.
  I've found a solution: set new role and use or operator at both expressions, 
but I do not like this way and searching tutorials didn't bring me better 
solution. I think that it must be possible to make it simplier. Third 
requirement to the same section will make xsl expressions much more 
complicated, next one will kill me. 

My (wrong) solution: I define new role combining both requirements and change 
xsl expressions by this way:
 



  

  auto
  page

  


Thank you for help,
  Pavel


On Sat, 13 Jun 2020 00:54:53 +0200
Pavel Vávra  wrote:

> Hallo Jirka,
>   thank you very much, it works as expected.
> Pavel
> 
> On Wed, 10 Jun 2020 21:33:58 +0200
> Jirka Kosek  wrote:
> 
> > On 10.6.2020 14:35, Pavel Vávra wrote:
> > > 
> > >   page
> > > 
> > > 
> > > ... but some small set of sections is much shorter than one page and I 
> > > want print them on one page together with previous one. Is it possible to 
> > > do it e.g. marking these sections with a role 'NoPgBreak'? What I need to 
> > > add to my xsl transformation to make it work?
> > 
> > You can use something like:
> > 
> > 
> >   
> > 
> >   auto
> >   page
> > 
> >   
> > 
> > 
> > -- 
> > --
> >   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.czStránky o dokumentačním formátu DocBook
> >   http://xmlguru.czBlog mostly about XML for English readers
> > --
> > 


pgpiLpP4orwA6.pgp
Description: PGP signature