From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68892 Path: news.gmane.org!not-for-mail From: pmlists@free.fr (Peter =?utf-8?Q?M=C3=BCnster?=) Newsgroups: gmane.comp.tex.context Subject: Re: xml syntax for \externalfigure Date: Sat, 04 Jun 2011 00:14:25 +0200 Message-ID: <87tyc6muke.fsf@micropit.couberia.bzh> References: <58F30E47-5D57-4252-9F6E-89EE8084EA94@uni-bonn.de> <4DE948FA.1040107@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307139280 9859 80.91.229.12 (3 Jun 2011 22:14:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Jun 2011 22:14:40 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Jun 04 00:14:35 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QScdV-00074g-QA for gctc-ntg-context-518@m.gmane.org; Sat, 04 Jun 2011 00:14:33 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D0BCBCAD89; Sat, 4 Jun 2011 00:14:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gAvNw4vcFbhl; Sat, 4 Jun 2011 00:14:30 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8EB65CAD8C; Sat, 4 Jun 2011 00:14:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9054BCAD8C for ; Sat, 4 Jun 2011 00:14:29 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VhBkrS71e83H for ; Sat, 4 Jun 2011 00:14:27 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id C357DCAD89 for ; Sat, 4 Jun 2011 00:14:27 +0200 (CEST) Original-Received: from smtp.smtpout.orange.fr (smtp05.smtpout.orange.fr [80.12.242.127]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p53MEQst011283 for ; Sat, 4 Jun 2011 00:14:27 +0200 Original-Received: from micropit.couberia.bzh ([90.32.137.95]) by mwinf5d52 with ME id raES1g00223gUPu03aESmu; Sat, 04 Jun 2011 00:14:26 +0200 Original-Received: by micropit.couberia.bzh (Postfix, from userid 1000) id C5C09160661; Sat, 4 Jun 2011 00:14:25 +0200 (CEST) Mail-Followup-To: mailing list for ConTeXt users In-Reply-To: (Thomas A. Schmitz's message of "Fri, 3 Jun 2011 22:56:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.12.242.127; country=FR; latitude=46.0000; longitude=2.0000; http://maps.google.com/maps?q=46.0000,2.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06EPyerLi - 7b67a474134b - 20110604 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:68892 Archived-At: On Fri, Jun 03 2011, Thomas A. Schmitz wrote: > Ah, expdoifelse is for "expanded doifelse," right? Any examples for such a lua > helper? Sounds good, but I still haven't been able to understand how to mix > xml and lua code. \startluacode function my_externalfigure(file, t) local args_present for k, v in pairs(t) do if v == "" then t[k] = nil else args_present = true end end context.externalfigure({file}, args_present and t) end \stopluacode \startxmlsetups xml:externalfigure \ctxlua{my_externalfigure("\xmlatt{#1}{resource}", {width = "\xmlatt{#1}{width}", height = "\xmlatt{#1}{height}"})} \stopxmlsetups My first idea was "\expanded{\externalfigure[...][\doif...]}" but it does not work... -- Peter ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________