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 15369 invoked from network); 10 Aug 2023 08:39:44 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 10 Aug 2023 08:39:44 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 777E0481561 for ; Thu, 10 Aug 2023 10:39:26 +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 TAZmUEZqelKS for ; Thu, 10 Aug 2023 10:39:26 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 731F148252F for ; Thu, 10 Aug 2023 10:37:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 4BF5B482259 for ; Thu, 10 Aug 2023 10:37:38 +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 0My1AUOCpKP1 for ; Thu, 10 Aug 2023 10:37:34 +0200 (CEST) Received: from ewsoutbound.kpnmail.nl (ewsoutbound.kpnmail.nl [195.121.94.167]) (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 9F2AB48224B for ; Thu, 10 Aug 2023 10:37:34 +0200 (CEST) X-KPN-MessageId: 1798ea7a-3759-11ee-88a0-005056abbe64 Received: from smtp.kpnmail.nl (unknown [10.31.155.39]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 1798ea7a-3759-11ee-88a0-005056abbe64; Thu, 10 Aug 2023 10:37:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=xs4all01; h=content-type:from:to:subject:mime-version:date:message-id; bh=8KIabExp9sPEqQL+RhVMt04bc5eF1wtRdxe6lxVn5ic=; b=JUfD77KqETfzIRAAbTRCdjlu8UTqopnsM6tBZKRZaRqCNPa/V3q+yJ/4LnONFrmyIo96Eb/SGw1Pp i5oF1vM6xI2AqbXc8dBzcTChinKYlQIoU/8vWyWQZ1Gdkd+NfFuqHAmMSdQnc8Swq8vimCgwJzGTjq zi9oT1QeE/fMDK3LpyotVpJcJvbM2rDiZMfYhvnnJfDKBaHRiHdmiFtAZ5seEo38iyca021X+h/r+2 ka/aUlu53Th0ueX2DxtTbq4U6Y6kMPDNgkKfNYtR2lTsUMukRB1Twnz3Z1F835hxL2urFV4Ey+MKji yMe3f9Y9RwNDx6/1rpWK/ni0rd36YOQ== X-KPN-MID: 33|Fn+u8Hq+t+1U4bvAtKZPnTj9GlThAoX1K1E+SVaXql6kwxi096WMt1YZQBKpFzk wsKviDaIu+y3hlk/F+qijuiGhX8r8g0+9z2MgrViwRS0= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|Xj+gYefpKm0ufjtBlXq0KJuG+iL9XCSq4OGhXcQmhz9lIluhbbHruqfe7UhAOzL x2Uv1coGBQesQ8sEhpvXshQ== X-Originating-IP: 213.125.29.162 Received: from [10.100.1.105] (d57d1da2.static.ziggozakelijk.nl [213.125.29.162]) by smtp.xs4all.nl (Halon) with ESMTPSA id 270f20db-3759-11ee-bd18-005056ab7447; Thu, 10 Aug 2023 10:37:34 +0200 (CEST) Message-ID: <08d2c2e9-7be4-e14e-e16a-b162b9771362@xs4all.nl> Date: Thu, 10 Aug 2023 10:37:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: en-US To: ntg-context@ntg.nl References: <89aff31c-5233-fba1-593a-27d8d56a3249@xs4all.nl> From: Hans Hagen In-Reply-To: Message-ID-Hash: HRUFM7ZPFEYL6DEDU7NOPXZS66JPUKIU X-Message-ID-Hash: HRUFM7ZPFEYL6DEDU7NOPXZS66JPUKIU X-MailFrom: j.hagen@xs4all.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: Map XML attributes to variables, dynamically List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 8/10/2023 10:14 AM, Thangalin wrote: > Here's an MWE: > > % SOT > \startbuffer[demo] > > >
> Text Goes Here >
>
> Different Text Goes Here >
> > > \stopbuffer > > \startxmlsetups xml:xhtml > \xmlsetsetup{\xmldocument}{*}{-} > \xmlsetsetup{\xmldocument}{html|body}{xml:*} > \xmlsetsetup{\xmldocument}{div}{xml:*} > \stopxmlsetups > > \xmlregistersetup{xml:xhtml} > > \startxmlsetups xml:html > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:body > \xmlflush{#1} > \stopxmlsetups > > \startxmlsetups xml:div > \setvariable{div}{\xmlatt{#1}{class}}{#1} > \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop > \stopxmlsetups > > \definestartstop[concurrent][ > before={TITLE: \xmlatt{\getvariable {div} {concurrent} {title}}}, > ] > > \starttext > \xmlprocessbuffer{main}{demo}{} > \stoptext > % EOT > > It doesn't look like the variables are taking, regardless of whether > {title} or {data-title} are used. \startxmlsetups xml:div \setvariable{div}{\xmlatt{#1}{class}}{#1} \start[\xmlatt{#1}{class}]\xmlflush{#1}\stop \stopxmlsetups \definestartstop [concurrent] [before={TITLE: \xmlatt{\getvariable{div}{concurrent}}{data-title}}] -- watch the braces -- use data-title and not title Hans ----------------------------------------------------------------- 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 ___________________________________________________________________________________