Hi, I get the same behaviour with a slightly older version. I don't really understand what's happening, but I agree it's not what I'd have expected. Best, Denis
-----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Pablo Rodriguez via ntg-context Gesendet: Freitag, 6. Mai 2022 18:21 An: Hans Hagen via ntg-context Cc: Pablo Rodriguez Betreff: [NTG-context] \xmlpos and \xmldepth misbehave? (again) Dear list,
I have the folloing sample:
\startbuffer[text] <doc>first level <s>second level <ss>third level</ss> <ss>third level</ss> </s> <s>second level <ss>third level</ss> <ss>third level</ss> </s> <s>second level <ss>third level</ss> <ss>third level</ss> </s> </doc> \stopbuffer
\startxmlsetups xml:text \xmlsetsetup{#1}{doc|s|ss}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:text}
\startxmlsetups xml:doc \chapter{\xmlpos{#1}\letterat\xmldepth{#1}: \xmlflush{#1}} \stopxmlsetups
\startxmlsetups xml:s \section{\xmlpos{#1}\letterat\xmldepth{#1}: \xmlflush{#1}} \stopxmlsetups
\startxmlsetups xml:ss \subsection{\xmlpos{#1}\letterat\xmldepth{#1}: \xmlflush{#1}} \stopxmlsetups
\setuphead[chapter,section,subsection][before=,after=,]
\setuppapersize[A7] \setuplayout[width=middle, header=0cm]
\starttext \xmlprocessbuffer{main}{text}{} \stoptext
All \xmldepth values are +1 that I think they should be (starting from 2 [instead of 1] up to 4 [instead of 3]).
\xmlpos values seem to count 2, 4, 6… (instead of 1, 2, 3…).
This is with current latest from 2022.05.02 16:19.
Sorry, but could anyone confirm whether I’m missing something or whether this issue is a bug?
Many thanks for your help,
Pablo
______________________________________________________________
_____________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
______________________________________________________________
_____________________