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, MAILING_LIST_MULTI,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3384 invoked from network); 10 Aug 2023 18:23:01 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 10 Aug 2023 18:23:01 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 9C74F4823EA for ; Thu, 10 Aug 2023 20:22:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oMyATq9GYpmT for ; Thu, 10 Aug 2023 20:22:31 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 2481E4824A5 for ; Thu, 10 Aug 2023 20:21:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3454F482201 for ; Thu, 10 Aug 2023 20:20:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3dw0sTYcLuUF for ; Thu, 10 Aug 2023 20:20:56 +0200 (CEST) Received: from outbound.soverin.net (outbound.soverin.net [185.233.34.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 9FD8B4821D6 for ; Thu, 10 Aug 2023 20:20:56 +0200 (CEST) Received: from smtp.freedom.nl (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4RMFbr3xBCz7s; Thu, 10 Aug 2023 18:20:56 +0000 (UTC) Received: from smtp.freedom.nl (smtp.freedom.nl [10.10.4.107]) by freedom.nl (Postfix) with ESMTPSA id 4RMFbr0Y7Yz6D; Thu, 10 Aug 2023 18:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freedom.nl; s=default; t=1691691656; bh=JrYSDXdOWmwEBK+HCV3g8O1Smnjc2OGhD4iX/mjMzsU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=QMNS4fxhn19zXSxrNJGeoJ1lu+5LoPFhJEBisx2agsEVeHKJbkYPGJwHDp6ouOcLw 29AmsrqPitHq6TFv1do+hHH2uCGo1Zyt0bstCnA/KMKM1leY7gxcPnQGoRmcP5ZqzH jSPKFKM22vI9pX9vYw6ZF57q8FuND/cAanv23gxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freedom.nl; s=default; t=1691691656; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wkekH1pYOnc6YCmdEzCqczrb9dc5lfcDRcK9VS4rp4I=; b=H1q9Fevl+WSAKn0ddMTRh86WsqC7qaBell+WFfJxJ/Kds+lLMTGPNNp+ADPoycHC5ieGID 4ucwnp0zGS25BAV1Tg/E2CeSJ5VKnj40UKm/hff4Vi/wZJYATdP9EI/duACZxFr9ikWVlb fWpF9oKvROHtXjZtKjjB2UKm0CDWIHE= ARC-Seal: i=1; s=default; d=freedom.nl; t=1691691656; a=rsa-sha256; cv=none; b=fTqrpvv289Bvy4TQ6rSRNyZiF3YRTueDdsImQhMet51PAbv1tPpnPPD0yR99uL9f6XgYsQ a8N3Uul9V1us2RCDTfywp3S1EY7TJE83XJ8s8UHCgnEerad0UjH+cTBFUX5iYTqG/5J6+m Kq0Xnshujc2Dp9GCsr6k5EynEUqPnGg= ARC-Authentication-Results: i=1; smtp.freedom.nl; auth=pass smtp.mailfrom=j.hagen@freedom.nl Message-ID: <8a32a0f7-3793-9848-ded2-5d8af497d5dc@freedom.nl> Date: Thu, 10 Aug 2023 20:20:54 +0200 MIME-Version: 1.0 Content-Language: en-US To: ntg-context@ntg.nl, denis.maier@unibe.ch References: X-Soverin-Authenticated: true In-Reply-To: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.4 cv=JPD98eGb c=1 sm=1 tr=0 ts=64d52a88 a=yaeGIPywLLJyAsH1IMTGEA==:117 a=yaeGIPywLLJyAsH1IMTGEA==:17 a=IkcTkHD0fZMA:10 a=MiNTnEJAAAAA:8 a=YEMqx4UAAAAA:8 a=ACQCx6kCAAAA:8 a=xtERp6CFAAAA:8 a=a3nu-2BBAAAA:8 a=Uows8UApAAAA:8 a=YcNENh43ALsazlFzjiwA:9 a=QEXdDO2ut3YA:10 a=LmrbSfiT3hecnSZifb5M:22 a=V0662LiR8DSfwiDagK97:22 a=Sab0UneHBzlWrQDlOuxD:22 a=ekCXXmE-vB8RPiJ3MEZb:22 a=oX0v64vK4IwbpfTCMRm2:22 X-Cloudmark-Reporter: TzTHpTSReRd0bFwC4Z9fAWFDcU0= Message-ID-Hash: JYUFW7OZ5E2PI57ILC5A5VRNMOY7WL5I X-Message-ID-Hash: JYUFW7OZ5E2PI57ILC5A5VRNMOY7WL5I X-MailFrom: j.hagen@freedom.nl X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: xml: matches always child of other element List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Hans Hagen via ntg-context Cc: Hans Hagen Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit Hi Denis, > Ok, after a bit of more testing I can now come up with another example. > > The version using startstop works, but with the normal command, I'm always getting back the content of the first element. I thought it might be an expansion issue, but \expanded and also expansion=yes or expansion=xml on \definedescription have no effect. Perhaps most interestingly, adding using the startstop variant together with the command variant gives correct results for the command as well (xml:index-entry-term-3). > > I have now found a way to proceed with my project (I'll just use the startstop variant), but I'd still be interested in understanding what is happening here. Does anyone know? Or is there anything I'm doing wrong here? This is kind of tricky but here is a variant test \startxmlsetups xml:index-entry-term-1 % does not work \indexentry{1: \xmlflush{#1}} % test \par \indexentry{2: \xmlflush{#1}} 3: \xmlflush{#1} \par \stopxmlsetups it has to do with the fact that when you don't use a start / stop the next paragraph is sees as description content so then you grab the same entry (sort of) nested you can uncomment the "test \par" to see the side effects (twice one versus 1/2) it's kind of hard to debug this, i admit, Hans > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > \startxmlsetups xml:test > \xmlsetsetup{#1}{*}{-} > \xmlsetsetup{#1}{index}{xml:*} > \xmlsetsetup{#1}{index-entry}{xml:index-entry} > %\xmlsetsetup{#1}{term}{xml:index-entry-term} > \xmlsetsetup{#1}{term}{xml:index-entry-term-2} > \xmlsetsetup{#1}{term}{xml:index-entry-term-3} > \stopxmlsetups > > \xmlregisterdocumentsetup{test}{xml:test} > > % Index > > \startxmlsetups xml:book-back > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index > \xmlflush{#1} > \stopxmlsetups > > \definedescription[indexentry][] > %\definedescription[indexentry][expansion=yes] % has no effect > %\definedescription[indexentry][expansion=xml] % has no effect > > > \startxmlsetups xml:index-entry > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index-entry-term % does not work > \expanded{\indexentry{\xmlflush{#1}}} > \indexentry{\xmlflush{#1}} > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index-entry-term-2 % works > \startindexentry{\xmlflush{#1}} > \xmlflush{#1} > \stopindexentry > \stopxmlsetups > > \startxmlsetups xml:index-entry-term-3 % works > \expanded{\indexentry{\xmlflush{#1}}} > \indexentry{\xmlflush{#1}} > \startindexentry{\xmlflush{#1}} > \xmlflush{#1} > \stopindexentry > \stopxmlsetups > > > \startbuffer[test] > > > > One > > > Two > > > Three > > > \stopbuffer > > \starttext > > \xmlprocessbuffer{test}{test}{} > > \stoptext > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > Von: denis.maier@unibe.ch > Gesendet: Montag, 24. Juli 2023 15:57 > An: ntg-context@ntg.nl > Betreff: [NTG-context] Re: xml: matches always child of other element > > Interestingly, we should be in the right subtree as this modified example is supposed to demonstrate (we're getting the correct numbers under each index-entry-term, just the terms are incorrect in all but the first case): > > \startxmlsetups xml:test > \xmlsetsetup{#1}{*}{-} > \xmlsetsetup{#1}{index}{xml:*} > \xmlsetsetup{#1}{index-entry}{xml:index-entry} > %\xmlsetsetup{#1}{index-entry}{xml:index-entry-2} > \xmlsetsetup{#1}{term}{xml:index-entry-term} > \xmlsetsetup{#1}{nav-pointer-group}{xml:*} > \xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer} > \xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link} > \stopxmlsetups > > \xmlregisterdocumentsetup{test}{xml:test} > > % Index > > \startxmlsetups xml:book-back > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index > \startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},] > \xmlflush{#1} > \stopsectionlevel > \stopxmlsetups > > \startxmlsetups xml:index-title > \xmlflush{#1} > \stopxmlsetups > > \definedescription[indexentry] > [alternative=top, > headstyle=normal, > headcommand=\hskip-1cm, > margin=1cm, > inbetween=, > ] > > \startxmlsetups xml:index-entry > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index-entry-2 > \xmlfilter{#1}{/term/command(xml:index-entry-term)}% > \xmlverbatim{#1} > \stopxmlsetups > > \startxmlsetups xml:index-entry-term > \indexentry{\xmlflush{#1}} > \stopxmlsetups > > \startxmlsetups xml:nav-pointer-group > \xmlconcat{#1}{/nav-pointer}{, } > \stopxmlsetups > > \startxmlsetups xml:nav-pointer > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:nav-pointer-link > \xmlflush{#1} > \stopxmlsetups > > \startbuffer[test] > > > > Index > > > First > > > 1 > > > 2 > > > 3 > > > > > Second > > > 4 > > > > > Third > > > 5 > > > 6 > > > 7 > > > > > \stopbuffer > > > \starttext > > \xmlprocessbuffer{test}{test}{} > > \stoptext > > Von: denis.maier@unibe.ch > > Gesendet: Montag, 24. Juli 2023 13:38 > An: ntg-context@ntg.nl > Betreff: [NTG-context] xml: matches always child of other element > > Hi, > > I must be missing something obvious, but in this example the pattern for always matches the first element, not the one under the current . > Interestingly, using xml:index-entry-2 instead of the normal version matches correctly... Any hints what is going off the rails here? > > Best, > Denis > > \startxmlsetups xml:test > \xmlsetsetup{#1}{*}{-} > \xmlsetsetup{#1}{index}{xml:*} > \xmlsetsetup{#1}{index-entry}{xml:index-entry} > %\xmlsetsetup{#1}{index-entry}{xml:index-entry-2} > \xmlsetsetup{#1}{term}{xml:index-entry-term} > \xmlsetsetup{#1}{nav-pointer-group}{xml:*} > \xmlsetsetup{#1}{nav-pointer}{xml:nav-pointer} > \xmlsetsetup{#1}{nav-pointer/ext-link}{xml:nav-pointer-link} > \stopxmlsetups > > \xmlregisterdocumentsetup{test}{xml:test} > > % Index > > \startxmlsetups xml:book-back > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index > \startsectionlevel[title={\xmlfilter{#1}{/index-title-group/title/command(xml:index-title)}},] > \xmlflush{#1} > \stopsectionlevel > \stopxmlsetups > > \startxmlsetups xml:index-title > \xmlflush{#1} > \stopxmlsetups > > \definedescription[indexentry] > [alternative=top, > headstyle=normal, > headcommand=\hskip-1cm, > margin=1cm, > inbetween=, > ] > > \startxmlsetups xml:index-entry > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:index-entry-2 > \xmlfilter{#1}{/term/command(xml:index-entry-term)}% > \xmlverbatim{#1} > \stopxmlsetups > > \startxmlsetups xml:index-entry-term > \indexentry{\xmlflush{#1}} > \stopxmlsetups > > \startxmlsetups xml:nav-pointer-group > \xmlconcat{#1}{/nav-pointer}{, } > \stopxmlsetups > > \startxmlsetups xml:nav-pointer > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:nav-pointer-link > \xmlflush{#1} > \stopxmlsetups > > \startbuffer[test] > > > > Index > > > First > > > 1 > > > 2 > > > 3 > > > > > Second > > > 1 > > > > > Third > > > 1 > > > > > \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://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 > ___________________________________________________________________________________ -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________