ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \xmlpos and \xmldepth misbehave? (again)
@ 2022-05-06 16:20 Pablo Rodriguez via ntg-context
       [not found] ` <5a62616155284b82b1445a0c7b036b68@unibe.ch>
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-05-06 16:20 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Pablo Rodriguez

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
___________________________________________________________________________________

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

* Re: \xmlpos and \xmldepth misbehave? (again)
       [not found] ` <5a62616155284b82b1445a0c7b036b68@unibe.ch>
@ 2022-05-12  7:48   ` Denis Maier via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Maier via ntg-context @ 2022-05-12  7:48 UTC (permalink / raw)
  To: ntg-context; +Cc: denis.maier, oinos

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 <ntg-context-bounces@ntg.nl> Im Auftrag von Pablo
> > Rodriguez via ntg-context
> > Gesendet: Freitag, 6. Mai 2022 18:21
> > An: Hans Hagen via ntg-context <ntg-context@ntg.nl>
> > Cc: Pablo Rodriguez <oinos@gmx.es>
> > 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
> >
> ______________________________________________________________
> > _____________________
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2022-05-12  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 16:20 \xmlpos and \xmldepth misbehave? (again) Pablo Rodriguez via ntg-context
     [not found] ` <5a62616155284b82b1445a0c7b036b68@unibe.ch>
2022-05-12  7:48   ` Denis Maier via ntg-context

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