ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] XML: flush to lua function
@ 2023-09-11 14:47 denis.maier
  2023-09-12  6:56 ` [NTG-context] " denis.maier
  0 siblings, 1 reply; 3+ messages in thread
From: denis.maier @ 2023-09-11 14:47 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 608 bytes --]

Hi,
I have the following xml setup with a lua function:

\startluacode
                function markingLength(s)
                _,n = s:gsub("%S+","")
                if n > 3 then
                context("yes" .. " ...") else context("no") end
                end
\stopluacode

\startxmlsetups xml:ink:ink-title:marking
                %\ctxlua{markingLength(\xmlflush{#1})}  % does not work
                \ctxlua{markingLength{"1 2 3 4"}}
\stopxmlsetups

While the function works, I cannot use xmlflush here. How can I properly pass the xml content to the lua function?

Best,
Denis

[-- Attachment #1.2: Type: text/html, Size: 3664 bytes --]

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2023-09-12  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11 14:47 [NTG-context] XML: flush to lua function denis.maier
2023-09-12  6:56 ` [NTG-context] " denis.maier
2023-09-12  7:52   ` Taco Hoekwater

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