Denis Maier schrieb am 26.04.2024 um 19:52:

I see. But there's no command that could be used to simulate an empty line?
If not, me should I perhaps try to replicate the wrapper structure from the XML source in context? (I'll also look into the format module of course.) What do you think?

Below is a different solution to your problem with works without \startlines because you already mark up each individual line in the poem which make it possible to add a linebreak in the output.

With \blank options (samepage) you can avoid pagebreaks between stanzas.

\startxmlsetups xml:test
    \xmlsetsetup{#1}{*}{-}
    \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:doc
    \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:poem
    \blank[line]
    \xmlflush{#1}
    \blank[back,line]
\stopxmlsetups

\startxmlsetups xml:stanza
   \xmlflush{#1}\blank[preference,line]
\stopxmlsetups

\startxmlsetups xml:line
    \xmlflush{#1}\blank[samepage,none]
\stopxmlsetups

\startbuffer[test]
<?xml version='1.0' standalone='yes?>
<doc>
<poem>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
</poem>
</doc>
\stopbuffer

\starttext

\samplefile{lorem}

\xmlprocessbuffer{test}{test}{}

\samplefile{lorem}

\stoptext

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

maillist : ntg-context@ntg.nl / 
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
___________________________________________________________________________________

Reply via email to