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.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12608 invoked from network); 17 Oct 2023 11:46:12 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 17 Oct 2023 11:46:12 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id C0F724834F2 for ; Tue, 17 Oct 2023 13:45:15 +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 ka4uWXlP8ead for ; Tue, 17 Oct 2023 13:45:15 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 0233048350D for ; Tue, 17 Oct 2023 13:44:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id F0DAF482538 for ; Tue, 17 Oct 2023 13:43:48 +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 FH-Cm5aaxpnc for ; Tue, 17 Oct 2023 13:43:48 +0200 (CEST) Received: from csmtpq2-prd-nl1-vfz.edge.unified.services (csmtpq2-prd-nl1-vfz.edge.unified.services [84.116.50.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 939694824A7 for ; Tue, 17 Oct 2023 13:43:48 +0200 (CEST) Received: from csmtp4-prd-nl1-vfz.nl1.unified.services ([100.107.80.18] helo=csmtp4-prd-nl1-vfz.edge.unified.services) by csmtpq2-prd-nl1-vfz.edge.unified.services with esmtp (Exim 4.93) (envelope-from ) id 1qsiUG-0054z2-70 for ntg-context@ntg.nl; Tue, 17 Oct 2023 13:43:48 +0200 Received: from smtpclient.apple ([84.104.102.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 128/128 bits) (Client did not present a certificate) by csmtp4-prd-nl1-vfz.edge.unified.services with ESMTPSA id siUFqWB5uIL3OsiUGqDaWx; Tue, 17 Oct 2023 13:43:48 +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=WpTtc/Tv c=1 sm=1 tr=0 ts=652e7374 cx=a_exe a=r8aFSP8g8qyxuwAfcqn69g==:117 a=r8aFSP8g8qyxuwAfcqn69g==:17 a=mIMCZczyAAAA:8 a=m81uF4VDAAAA:8 a=MiNTnEJAAAAA:8 a=YEMqx4UAAAAA:8 a=ACQCx6kCAAAA:8 a=NEAV23lmAAAA:8 a=a3nu-2BBAAAA:8 a=ALVheLq2aV7WxJRC4uMA:9 a=CjuIK1q_8ugA:10 a=-GcMAM2ua97IflUbVcQA:9 a=2XforQ-5eFwaWQ7O:21 a=_W_S_7VecoQA:10 a=dnis4eNY8yc3Zh5OXdl7:22 a=rLsCLBPhH2cUqIPP-PLs:22 a=LmrbSfiT3hecnSZifb5M:22 a=V0662LiR8DSfwiDagK97:22 a=Sab0UneHBzlWrQDlOuxD:22 a=ekCXXmE-vB8RPiJ3MEZb:22 X-Authenticated-Sender: havdmeer@ziggo.nl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ziggo.nl; s=202002corplgsmtpnl; t=1697543028; bh=G3oEFbXWiHtalB+9gJYZc24VJxcTVxe+mrkdF1f0vgQ=; h=From:Subject:Date:References:To:In-Reply-To; b=jaNmCvzct4LUkfTSRFfQzZME3LTGjjTvGsQbicKI5RGyES1pZ0ICETc69wmbHLWRa X6sKDWgDJjKLqfLAyqp0ZAJTJN5UG4pWjerOm2vJGVAJND7diE3U9mENzGLpUnvuhP XsWaJVs4ASyT4Xabf1QLpjAJ6SdPHJ/dzvg3TvQz92V/eBwywqS+QtmtaTUXUKKvC+ yLKpsXS/naK6rYJzCVXoB5RGwnoOFoookOfghln/zU+p9gdA6n2yMltU6oevR8a5KN 3GY59zJNAQzXP+4ePXDItd446hOlQi9avRFk5PAwC1LYKMhepV8bMg5HqOL0SiDLj6 8fdjXNiksndDw== Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Date: Tue, 17 Oct 2023 13:43:37 +0200 References: <06B8FF89-A540-498E-86D8-D79ABCBD744B@bittext.nl> To: NTG ConTeXt In-Reply-To: <06B8FF89-A540-498E-86D8-D79ABCBD744B@bittext.nl> Message-Id: <03B31AC9-9EA2-4DE3-855A-4983CE12383E@ziggo.nl> X-Mailer: Apple Mail (2.3731.700.6) X-CMAE-Envelope: MS4xfO+QplGK+IaIxTspsQfCajNd62s/qzKMHKfV3Bz7iDdEBvsv9kwcnV5vQxV0omyN/EnUOzYyEIRIuZoY38Ogd8Ta2A2wZwrRkPS8W47h2pLk2sPl5M0t gNIe5aY0Pjfpfir6Xw1YN/sH+hv4HUd24M8T2h+K1ZqfLbnLArrYwS9yrRIoaKuFJffTfuqKOhY52g== Message-ID-Hash: PEPAKOVB2HWL5JO2FJNBOYPQWSCDKYLN X-Message-ID-Hash: PEPAKOVB2HWL5JO2FJNBOYPQWSCDKYLN X-MailFrom: havdmeer@ziggo.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: Testing whether an XML attribute exists List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Hans van der Meer via ntg-context Cc: Hans van der Meer Content-Type: multipart/mixed; boundary="===============9013994357799714901==" --===============9013994357799714901== Content-Type: multipart/alternative; boundary="Apple-Mail=_6D65BB44-A2FB-478E-8373-0F1D4C1DDBEE" --Apple-Mail=_6D65BB44-A2FB-478E-8373-0F1D4C1DDBEE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii But there is also \ifxmlattempty{#1}{prefix} .. \else .. \fi yours sincerely dr. Hans van der Meer > On 17 Oct 2023, at 13:37, Taco Hoekwater wrote: >=20 >=20 >=20 >> On 17 Oct 2023, at 12:43, Michael Guravage = wrote: >>=20 >> Hi, >>=20 >> I am typesetting a very simple address list whose source is written = in XML. Typesetting choices need to be made dependent on the presence = of various attributes; consider the following element.=20 >>=20 >> >>=20 >> If the prefix attribute exists I'l like the name to appear as, e.g. = 'Boer, den." The several XML attribute testing functions in the XML = manual appear to discriminate on an attribute's value. I tried = \xmldoifnotatt in an attempt to say, "TRUE if prefix does not match an = empty string", since I am not interested in the attribute's value but = only whether or not it exists. The code below doesn't work. If someone = who knows why it doesn't work would enlighten my ignorance I would be = most grateful. A brief explanation and example of \xmldoifatt, = \xmldoifnotatt, and \xmldoifelseatt would be exceedingly helpful. >>=20 >> \startxmlsetups xml:list:family >> {\bf \xmlatt{#1}{surname} \xmldoifnotatt{#1, prefix, ''} {, = \xmlatt{#1}{prefix}}} \crlf >=20 >=20 > Syntax error there, you need: >=20 > \xmldoifnotatt{#1}{prefix}{}{, \xmlatt{#1}{prefix}} >=20 > Best wishes, > Taco > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / = https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net = (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > = __________________________________________________________________________= _________ --Apple-Mail=_6D65BB44-A2FB-478E-8373-0F1D4C1DDBEE Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii But there is = also
= \ifxmlattempty{#1}{prefix} .. \else .. \fi

yours sincerely
dr. Hans van der = Meer



On 17 Oct 2023, at 13:37, Taco = Hoekwater <taco@bittext.nl> wrote:



On 17 Oct 2023, at 12:43, Michael Guravage = <guravage@literatesolutions.com> wrote:

Hi,

I am = typesetting a very simple address list whose source is written in XML. =  Typesetting choices need to be made dependent on the presence of = various attributes; consider the following <family> element. =

<family surname=3D"Boer" prefix=3D"den">

If the = prefix attribute exists I'l like the name to appear as, e.g. 'Boer, = den."  The several XML attribute testing functions in the XML = manual appear to discriminate on an attribute's value. I tried =  \xmldoifnotatt in an attempt to say, "TRUE if prefix does not = match an empty string",  since I am not interested in the = attribute's value but only whether or not it exists. The code below = doesn't work. If someone who knows why it doesn't work would enlighten = my ignorance I would be most grateful. A brief explanation and example = of \xmldoifatt, \xmldoifnotatt, and \xmldoifelseatt would be exceedingly = helpful.

\startxmlsetups xml:list:family
 {\bf = \xmlatt{#1}{surname} \xmldoifnotatt{#1, prefix, ''} {, = \xmlatt{#1}{prefix}}} \crlf


Syntax error there, = you need:

 \xmldoifnotatt{#1}{prefix}{}{, = \xmlatt{#1}{prefix}}

Best = wishes,
Taco
_______________________________________________________= ____________________________
If your question is of interest to = others as well, please add an entry to the Wiki!

maillist : = ntg-context@ntg.nl / = https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage =  : https://www.pragma-ade.nl / https://context.aanhet.net = (mirror)
archive  : = https://github.com/contextgarden/context
wiki =     : = https://wiki.contextgarden.net
________________________________________= ___________________________________________

= --Apple-Mail=_6D65BB44-A2FB-478E-8373-0F1D4C1DDBEE-- --===============9013994357799714901== 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============9013994357799714901==--