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, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12403 invoked from network); 17 Oct 2023 11:41:04 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 17 Oct 2023 11:41:04 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 249F1483451 for ; Tue, 17 Oct 2023 13:39:33 +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 zklmM2oZ0CHB for ; Tue, 17 Oct 2023 13:39:32 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id BCC494833B7 for ; Tue, 17 Oct 2023 13:38:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 269B048337B for ; Tue, 17 Oct 2023 13:38:28 +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 1WrlUTvzVe_s for ; Tue, 17 Oct 2023 13:38:27 +0200 (CEST) Received: from host3.aanhet.net (host5.aanhet.net [85.10.129.212]) (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 CFCBA483379 for ; Tue, 17 Oct 2023 13:38:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by host3.aanhet.net (Postfix) with ESMTP id AF924404F8 for ; Tue, 17 Oct 2023 13:38:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bittext.nl; h= x-mailer:message-id:in-reply-to:references:date:date:subject :subject:mime-version:content-transfer-encoding:content-type :content-type:from:from; s=default; t=1697542682; x=1699357083; bh=9RMh0zbYXpU9Bqu4O9MaRpUXt+9y4JMloHr8MnArtW8=; b=Pcvy7K/FqA4B ndhCXR/Z/ezcBuDppBsXKyL+dOxfKctzh4UPogOy3ajRPcDF7QKTtTc6YE4RVY/T M1MkchtvghwXcSdr5+p6aoYl+t1Od6tR2FP5h2kWlR0Sbyr/eU6ZblmB10YpTa9t 1xL1dgxIUFFjyLv5AKDjruOLAqTjRTgUrL7ydYrA9ts1rF8AUETtP81ks+vvq5DR 91plzueBKr3utIw3P9exRYrWP5AXb+Uc34ViWzYkSZ69PT/T+J9NlVMvf0QwAP76 WvZKkgnC0Yfwz6Z7tyhKPtaZ3AgGK41SVREeJCVzr6XQILooA7WPraqwq3NfrIdD zwkRhtE7Wg== X-Virus-Scanned: Debian amavisd-new at host3.aanhet.net Received: from host3.aanhet.net ([127.0.0.1]) by localhost (host3.aanhet.net [127.0.0.1]) (amavisd-new, port 10026) with LMTP id 3fA_gcvRvhCT for ; Tue, 17 Oct 2023 13:38:02 +0200 (CEST) Received: from smtpclient.apple (2a02-a452-9749-1-80de-a6d9-5174-8d55.fixed6.kpn.net [IPv6:2a02:a452:9749:1:80de:a6d9:5174:8d55]) (Authenticated sender: taco@bittext.nl) by host3.aanhet.net (Postfix) with ESMTPSA id 6E475404EC for ; Tue, 17 Oct 2023 13:38:02 +0200 (CEST) From: Taco Hoekwater Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Date: Tue, 17 Oct 2023 13:37:47 +0200 References: To: mailing list for ConTeXt users In-Reply-To: Message-Id: <06B8FF89-A540-498E-86D8-D79ABCBD744B@bittext.nl> X-Mailer: Apple Mail (2.3731.700.6) Message-ID-Hash: VFG5KT267JG2AWZF2R33DZH4ZID4UWAT X-Message-ID-Hash: VFG5KT267JG2AWZF2R33DZH4ZID4UWAT X-MailFrom: taco@bittext.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: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > On 17 Oct 2023, at 12:43, Michael Guravage 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 element. > > > > 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 ___________________________________________________________________________________