ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml attribute conditional
@ 2011-12-12 23:48 Jon Crump
  2011-12-13  9:33 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Crump @ 2011-12-12 23:48 UTC (permalink / raw)
  To: ntg-context

All,

I have a conditional expression that checks to see if the current node
has any ancestor whose xml:id attribute matches a string

\xmldoifelse{#1}{ancestor::div[@xml:id='apr_engl']}

What I need is a test to see if the current node has any ancestor
whose xml:id attribute _contains_ a substring. Something like this:

\xmldoifelse{#1}{ancestor::div[ @xml:id contains('_engl')]}

trying this:
\xmldoifelse{#1}{ancestor::div[ contains(@xml:id, '_engl')]}

got me this error:
! LuaTeX error <    local expr = xml.expressions...>:3: bad argument
#1 to 'contains' (string expected, got nil)

any suggestions?

Jon
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2011-12-14 23:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12 23:48 xml attribute conditional Jon Crump
2011-12-13  9:33 ` Hans Hagen
2011-12-13 19:21   ` Jon Crump
2011-12-14  0:02     ` Hans Hagen
2011-12-14 18:33       ` Jon Crump
2011-12-14 21:53         ` Hans Hagen
2011-12-14 23:49           ` Jon Crump

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).