Hi Dave,
On Sat, 2025-10-11 at 19:06 -0700, Thangalin wrote:
> Max produced an answer that almost worked; the issue is that it uses
> "grabbufferdata" and depends on the literal phrase "startheader" and
> "stopheader". The problem with that approach is the document start/stop
> environments are created dynamically based on DIV class names, as per the
> following code:
>
> % Map arbitrary div classes, defined by fenced divs.
> \startxmlsetups xml:div
> % Capture attributes as variables.
> \setvariable{div}{\xmlatt{#1}{class}}{#1}
> \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop{}
> \stopxmlsetups
Untested and fairly ugly, but I would expect for something like the
following to work:
\startxmlsetups xml:div
% Capture attributes as variables.
\setvariable{div}{\xmlatt{#1}{class}}{#1}
\doifelsesamestring{\xmlatt{#1}{class}}{header}{
\xmltobuffer{#1}{.}{headercontents}
\getbuffer[header]
}{
\start[\xmlatt{#1}{class}]\xmlflush{#1}\stop{}
}
\stopxmlsetups
Thanks,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________