From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 96B562382C for ; Tue, 18 Jun 2024 11:39:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 8C338483F2E for ; Tue, 18 Jun 2024 11:39:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=ziggo.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 AOzyF_ql0WHd for ; Tue, 18 Jun 2024 11:39:30 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 241EF48224A for ; Tue, 18 Jun 2024 11:39:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 4FFF44800F0 for ; Tue, 18 Jun 2024 11:39:05 +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 3J-b0X4fRaCa for ; Tue, 18 Jun 2024 11:39:04 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=84.116.50.19; helo=csmtpq1-prd-nl1-vfz.edge.unified.services; envelope-from=havdmeer@ziggo.nl; receiver= Received: from csmtpq1-prd-nl1-vfz.edge.unified.services (csmtpq1-prd-nl1-vfz.edge.unified.services [84.116.50.19]) (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 D50904800E8 for ; Tue, 18 Jun 2024 11:39:04 +0200 (CEST) Received: from csmtp1-prd-nl1-vfz.nl1.unified.services ([100.107.80.133] helo=csmtp1-prd-nl1-vfz.edge.unified.services) by csmtpq1-prd-nl1-vfz.edge.unified.services with esmtp (Exim 4.93) (envelope-from ) id 1sJVIs-0003Eb-7N for ntg-context@ntg.nl; Tue, 18 Jun 2024 11:39:02 +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 csmtp1-prd-nl1-vfz.edge.unified.services with ESMTPSA id JVIssG4Ku05UYJVIssyTpn; Tue, 18 Jun 2024 11:39:02 +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=NoGDcNdJ c=1 sm=1 tr=0 ts=667155b6 cx=a_exe a=r8aFSP8g8qyxuwAfcqn69g==:117 a=r8aFSP8g8qyxuwAfcqn69g==:17 a=pGLkceISAAAA:8 a=MiNTnEJAAAAA:8 a=YEMqx4UAAAAA:8 a=ACQCx6kCAAAA:8 a=NEAV23lmAAAA:8 a=a3nu-2BBAAAA:8 a=vn2sti7V5wjfT4xYF1QA:9 a=CjuIK1q_8ugA:10 a=L5PZlnQcj9zEkjDT-NkA:9 a=YUJiHRALLc3OXvmD:21 a=_W_S_7VecoQA:10 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=1718703542; bh=CK2/vG+H0MDOmFZ5vA6C8GUpq52UNapobRhUsu2LIYs=; h=From:Subject:Date:References:To:In-Reply-To; b=cRPJViZ4A5zFtHeYn4h+J6LKhP7+4N+qrUjm375SRNSAFrXInEUrI19uTgFqNSkKR S/fX/MIdTd28EcuUHPsl0Fc0bkhoBNK5EBZQNZF3beCGVwQFaqZVAMkr8kRhht8rCT 5tvxnCpUFT4MHJs9H//sbu6bN+Q6dff3f9TOktJ1wYoBxwuQBgHSzjU8dZmMq++ZFT Z1I95LbUC2UqH+R3CM0Br9SKQd2sFN2DZfIBx07Yt7sTEARnsgg9NIp5wJlDyWThgK khNhp9y67QFFXxTKFi98hnHD6oXeRQQDCAHJQ3Dsrwkjr14aXq04+VpB2XRIx2lsXR mdLCvFh0XAiDg== Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Date: Tue, 18 Jun 2024 11:38:51 +0200 References: <87F32ADF-FCDA-49EB-8B7C-DD778CF61D38@ziggo.nl> <7771bf76-eff5-82e8-5e5f-a1af801b278f@gmail.com> <45BCE2B3-7B0E-4D7B-B164-BB610C5DF23F@ziggo.nl> <70c27b56-aeae-9f99-80db-94eb06fb0410@gmail.com> To: NTG ConTeXt In-Reply-To: <70c27b56-aeae-9f99-80db-94eb06fb0410@gmail.com> Message-Id: <304BEEDD-ACC0-4EE9-B3F7-DA6DFB7128AD@ziggo.nl> X-Mailer: Apple Mail (2.3774.400.31) X-CMAE-Envelope: MS4xfGGhREuinH3jhrk1uCOqsKkC5PTC6htszhQNqaNd+GU87Iafhd/fX3ELJHM/U7SPjc/FocK9NmCGGWuTpKzAOoh5yTl47cLOfz7u5cYjGGOcLhLmUTqb gHTJ3OiSUROTY9A9wTA0Rua+xX/5UxOc3nfk8iiMKgYIo1Jucew3e3UwUSilz4ATwdDjeKJPVii+mg== Message-ID-Hash: G5H67GTH6EEMVPXDH7BODZNBVC6OMOPI X-Message-ID-Hash: G5H67GTH6EEMVPXDH7BODZNBVC6OMOPI 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: expanded doif's 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="===============0998987309550951878==" --===============0998987309550951878== Content-Type: multipart/alternative; boundary="Apple-Mail=_042C8E38-9DA6-4B69-A6BA-94EA00AFA839" --Apple-Mail=_042C8E38-9DA6-4B69-A6BA-94EA00AFA839 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Finally found the culprit. Macro call to restart reporting errors in the = printed output residing at the wrong point in the code. Again thanks for pointing out where it was not. yours sincerely dr. Hans van der Meer > On 17 Jun 2024, at 16:52, Wolfgang Schuster = wrote: >=20 > Hans van der Meer schrieb am 17.06.2024 um 09:01: >> I want to show an errormessage when the macro is undefined. It = requires expansion of \xmlatt{#1}{name}. >> \ifdefined\xmlatt{#1}{name} didn't worked nor \expandafter\ifdefined >> I thought of the expanding \doif's. >> See the attached output of this xmlsetup attached. >> \startxmlsetups hvdm:system:macrocall >> % >> \doifelsedefined{\xmlatt{#1}{name}} >> { >> % >> %macro without argument >> % >> \ifxmlattempty{#1}{arg} >> \begincsname\xmlatt{#1}{name}\endcsname >> % >> %macro with argument >> % >> \else >> \begincsname\xmlatt{#1}{name}\endcsname{\xmlatt{#1}{arg}} >> \fi >> } >> { >> \ERROR{macro \xmlatt{#1}{name} is not defined} >> } >> \stopxmlsetups >=20 > I have no idea what's wrong in your code without a proper minimal = example. As the example below shows you can use \doifelsedefined in = combination with \xmlatt. >=20 > \startbuffer[ifdefined] > > > > > \stopbuffer >=20 > \startxmlsetups xml:document > \xmlflush{#1} > \stopxmlsetups >=20 > \startxmlsetups xml:macro >=20 > \doifelsedefined{\xmlatt{#1}{name}} > {\texdefinition{\xmlatt{#1}{name}}{\xmlatt{#1}{arg}}} > {{\tttf macro \tex{\xmlatt{#1}{name}} not defined}} >=20 > % \ifcsname\xmlatt{#1}{name}\endcsname > % \lastnamedcs{\xmlatt{#1}{arg}} > % \else > % % > % \fi >=20 > \stopxmlsetups >=20 > \startxmlsetups xml:hvdm > \xmlsetsetup{\xmldocument}{document|macro}{xml:*} > \stopxmlsetups >=20 > \xmlregistersetup{xml:hvdm} >=20 > \starttext > \xmlprocessbuffer{hvdm}{ifdefined}{} > \stoptext >=20 > Wolfgang > = __________________________________________________________________________= _________ > 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=_042C8E38-9DA6-4B69-A6BA-94EA00AFA839 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Finally found = the culprit. Macro call to restart reporting errors in the printed = output residing at the wrong point in the code.
Again thanks for = pointing out where it was not.

yours sincerely
dr. Hans van der = Meer



On 17 Jun 2024, at 16:52, = Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> = wrote:

Hans van = der Meer schrieb am 17.06.2024 um 09:01:
I = want to show an errormessage when the macro is undefined. It requires = expansion of \xmlatt{#1}{name}.
\ifdefined\xmlatt{#1}{name} didn't = worked nor \expandafter\ifdefined
I thought of the expanding = \doif's.
See the attached output of this xmlsetup = attached.
\startxmlsetups = hvdm:system:macrocall
%
\doifelsedefined{\xmlatt{#1}{name}}
{
= %
%macro without = argument
%
\ifxmlattempty{#1}{arg}
\begincsname\xmlatt{#1}{name}\= endcsname
%
%macro with = argument
%
\else
\begincsname\xmlatt{#1}{name}\endcsname{\xmlatt{= #1}{arg}}
\fi
}
{
\ERROR{macro \xmlatt{#1}{name} is not = defined}
}
\stopxmlsetups

I have no idea = what's wrong in your code without a proper minimal example. As the = example below shows you can use \doifelsedefined in combination with = \xmlatt.

\startbuffer[ifdefined]
<document>
=  <macro name=3D"bold" arg=3D"text"/>
 <macro = name=3D"hvdm" = arg=3D"text"/>
</document>
\stopbuffer

\startxmlsetu= ps xml:document
=  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups = xml:macro

 \doifelsedefined{\xmlatt{#1}{name}}
=    {\texdefinition{\xmlatt{#1}{name}}{\xmlatt{#1}{arg}}}    {{\tttf macro \tex{\xmlatt{#1}{name}} not = defined}}

% \ifcsname\xmlatt{#1}{name}\endcsname
% =   \lastnamedcs{\xmlatt{#1}{arg}}
% \else
% =   %
% \fi

\stopxmlsetups

\startxmlsetups = xml:hvdm
\xmlsetsetup{\xmldocument}{document|macro}{xml:*}
\stopxmls= etups

\xmlregistersetup{xml:hvdm}

\starttext
\xmlprocessb= uffer{hvdm}{ifdefined}{}
\stoptext

Wolfgang
_________________= __________________________________________________________________
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=_042C8E38-9DA6-4B69-A6BA-94EA00AFA839-- --===============0998987309550951878== 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 ___________________________________________________________________________________ --===============0998987309550951878==--