[NTG-context] counting characters when dealing with XML

Pablo Rodriguez oinos at gmx.es
Tue Jan 20 20:50:27 CET 2015


Dear list,

I have a question when dealing with XML.

Is there any way to write a conditional based on the number of
characters in a given field?

I mean, the following field:

    \xmltext{#1}{h1[@class='subtitle']}

If subtitle > 60 chars, then fontsize = 10pt.
If subtitle > 50 chars, then fontsize = 12pt.
If subtitle > 40 chars, then fontsize = 14pt.
If subtitle > 30 chars, then fontsize = 16pt.

How could I write these conditionals?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk


More information about the ntg-context mailing list