
On 2/27/2025 3:23 PM, Denis Maier via ntg-context wrote:
Ok, I've found it. The problem is that I have something in the xml file that produces spurios spaces, which I try to get rid of with \removeunwantedspaces. However, this seems to have an effect on the wanted \qquad. Is there a way to remove unwanted spaces inside a given element without affecting earlier spaces (in other elements) that should appear? I guess \xmlstrip could be a solution to this problem, but I don't quite understand how this works.
\xmlstrip{#1}{.} \xmlstrip{#1}{/*} or s stripped finalizer .. depends on where used
Best, Denis
%%%%%%%%%%%%% Updated Example %%%%%%%%%%%%%%%%% \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{index|index-entry|num}{xml:*} \stopxmlsetups
\xmlregisterdocumentsetup{test}{xml:test}
\startxmlsetups xml:index \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:index-entry \startparagraph \xmlfilter{#1}{/term/command(xml:term)}\qquad\qquad\qquad\xmlfilter{#1}{/loc/command(xml:loc)} \stopparagraph \stopxmlsetups
\startxmlsetups xml:term \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:loc \removeunwantedspaces \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:num \xmlflush{#1} \stopxmlsetups
\startbuffer[test] <?xml version="1.0" encoding="UTF-8"?> <index> <index-entry> <term>asdf</term> <loc> <num>1</num> </loc> </index-entry> </index> \stopbuffer
\starttext
\xmlprocessbuffer{test}{test}{}
\stoptext
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------