ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* counting characters when dealing with XML
@ 2015-01-20 19:50 Pablo Rodriguez
  2015-01-20 23:36 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo Rodriguez @ 2015-01-20 19:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-22 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 19:50 counting characters when dealing with XML Pablo Rodriguez
2015-01-20 23:36 ` Hans Hagen
2015-01-22 18:32   ` Pablo Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).