From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12810 invoked from network); 22 May 2023 12:53:26 -0000 Received: from zapf.ntg.nl (5.39.185.232) by inbox.vuxu.org with ESMTPUTF8; 22 May 2023 12:53:26 -0000 Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8542F1C2F15; Mon, 22 May 2023 14:53:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.ntg.nl Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mu-YKMH4OlgU; Mon, 22 May 2023 14:52:59 +0200 (CEST) Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F2D7D1C37FF; Mon, 22 May 2023 14:52:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2D4651C37FF for ; Mon, 22 May 2023 14:52:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.ntg.nl Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EaJElp7CCX11 for ; Mon, 22 May 2023 14:52:56 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.54.42.168; helo=smtpq5.tb.mail.iss.as9143.net; envelope-from=havdmeer@ziggo.nl; receiver= Received: from smtpq5.tb.mail.iss.as9143.net (smtpq5.tb.mail.iss.as9143.net [212.54.42.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 5A3801C2F15 for ; Mon, 22 May 2023 14:52:56 +0200 (CEST) Received: from [212.54.42.106] (helo=smtp2.tb.mail.iss.as9143.net) by smtpq5.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1520-0004su-0V for ntg-context@ntg.nl; Mon, 22 May 2023 14:52:56 +0200 Received: from smtpclient.apple ([84.104.102.59]) by smtp2.tb.mail.iss.as9143.net with ESMTPA id 151zq3DakXCJm151zqaiQp; Mon, 22 May 2023 14:52:55 +0200 X-Env-Mailfrom: havdmeer@ziggo.nl X-Env-Rcptto: ntg-context@ntg.nl X-SourceIP: 84.104.102.59 X-CNFS-Analysis: v=2.4 cv=AMfGfOXb c=1 sm=1 tr=0 ts=646b65a8 cx=a_exe a=r8aFSP8g8qyxuwAfcqn69g==:117 a=r8aFSP8g8qyxuwAfcqn69g==:17 a=qCruoHQPPgguFgf6BgUA:9 a=CjuIK1q_8ugA:10 a=35tdAkmoN4SNvAEsT2QA:9 a=npW-z2BTH241TBO8:21 a=_W_S_7VecoQA:10 X-Authenticated-Sender: havdmeer@ziggo.nl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ziggo.nl; s=202002corplgsmtpnl; t=1684759975; bh=b6ieaRYLIPyQRnKwbGHXZRr074NSubkOEes0CHHKsiA=; h=From:Subject:Date:To; b=Cd2idXG4bneEoT+7wv+4itGJFUNcQp5VfaqSUorFtA5V6fuHCEHmVRtixcG2376pH PobZbG705nrPqanfmnafj9G2WNx13Lt1IbdjbNnnTqPC9qafqgoSI575Qx1azm8AP3 Y5zCyLC9hzuI54qxK63lo8rV47UJ6EopQjWudOjIvWbRUXzP98vn8b4sILMmbQ5Hsm dbDTvSoQ3lVvqLpyOLNZS7otONCVnOArohGWH1EElj2GPW0uoqQVQlqqG4yrqjgHET XRY4+ypE0guEvh1kBgqGpFaDfd+IY7NKxYaEY+/WXF8jDUei9zAskfLW+05aabXpLW 7+pHQxyFkt/wQ== Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Message-Id: Date: Mon, 22 May 2023 14:52:45 +0200 To: NTG ConTeXt X-Mailer: Apple Mail (2.3731.600.7) X-CMAE-Envelope: MS4xfOxTzj4f0HTZhEGa+W6aXG15nuqJhNQ/czMfWfAvFGjc38vk2q9uWUS1qHbvor48v+Y42mLZz3eRchOLIYig0//sYOaii+CJTjmsB87OVQj4XwpLoZ75 2ss3IxjvwV4mYM5+eqON5dgPFG4yah9ZeQJfs0/aUKf+e1XNq4RluJ0PAfRNfx3ScN2qD/RSRFG5Rw== Subject: [NTG-context] position in xmlfilter X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.38 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Hans van der Meer via ntg-context Reply-To: mailing list for ConTeXt users Cc: Hans van der Meer Content-Type: multipart/mixed; boundary="===============1810992912711210936==" Errors-To: ntg-context-bounces@ntg.nl Sender: "ntg-context" --===============1810992912711210936== Content-Type: multipart/alternative; boundary="Apple-Mail=_11C08293-310A-4F18-A618-A5848651A9C0" --Apple-Mail=_11C08293-310A-4F18-A618-A5848651A9C0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I do not understand the behaviour of certain function is xml processing. My problem is finding the position of the current node, for example with = I would like to see the first resulting in 1 and the = second in 2. The result of some experiments: return=3D[\xmlfilter{#1}{../tag()}] returns the parent tag, = in this case [setup] as expected return=3D[\xmlfilter{#1}{./tag()}] returns the tag, in this = case [example] as expected return=3D[\xmlfilter{#1}{../position()}] returns [] i.e. returns = nothing expecting a number return=3D[\xmlfilter{#1}{./position()}] returns [] i.e. returns nothing = expecting a number return=3D[\xmlfilter{#1}{../index()}] returns [0] expecting a number = larger than 0 return=3D[\xmlfilter{#1}{./index()}] returns [0] expecting a number = larger than 0 dr. Hans van der Meer --Apple-Mail=_11C08293-310A-4F18-A618-A5848651A9C0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I do not = understand the behaviour of certain function is xml processing.
My = problem is finding the position of the current node, for example with = <A><B><A> I would like to see the first <A> = resulting in 1 and the second in 2.
The result of some = experiments:

return=3D[\xmlfilter{#1}{../tag()}] returns the parent tag, = in this case [setup] as expected
return=3D[\xmlfilter{#1}{./tag()}] = returns the tag, in this case [example] as = expected
return=3D[\xmlfilter{#1}{../position()}] returns = [] i.e. returns nothing expecting a = number
return=3D[\xmlfilter{#1}{./position()}] returns [] i.e. returns nothing = expecting a number
return=3D[\xmlfilter{#1}{../index()}] returns [0] expecting a number = larger than 0
return=3D[\xmlfilter{#1}{./index()}] returns [0] expecting a number = larger than 0

dr. Hans van der = Meer
= --Apple-Mail=_11C08293-310A-4F18-A618-A5848651A9C0-- --===============1810992912711210936== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________ --===============1810992912711210936==--