ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: Ben Moon via ntg-context <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: xmlpos values doubled
Date: Wed, 20 Apr 2022 16:53:23 +0200	[thread overview]
Message-ID: <90e4b126-07c5-3e6e-3487-5c426a881b29@gmx.es> (raw)
In-Reply-To: <33882cbd-d469-4c41-ae07-2d0368758316@www.fastmail.com>

On 4/20/22 11:51, Ben Moon via ntg-context wrote:
> Hello again,
>
> I wonder whether anyone has some thoughts to help with my problem?
> Either why \xmlpos gives double values or alternatives to arrange my
> table format?

Hi Ben,

I think that both \xmlpos and \xmldepth give weird results.

With this minimal 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=,]
  \starttext
  \xmlprocessbuffer{main}{text}{}
  \stoptext

\xmldepth shows values that I think are +1 than they should be.

\xmlpos counts in pairs and not in units (as you wrote, 2, 4, 6...).

Hans, could you check whether this is working as expected?

Sorry, but if this isn’t a bug, I have no idea of what I may be missing.

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
___________________________________________________________________________________

      reply	other threads:[~2022-04-20 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28  9:44 Ben Moon via ntg-context
2022-04-20  9:51 ` Ben Moon via ntg-context
2022-04-20 14:53   ` Pablo Rodriguez via ntg-context [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90e4b126-07c5-3e6e-3487-5c426a881b29@gmx.es \
    --to=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).