From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77721 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Struggling with ConTeXt Date: Fri, 03 Aug 2012 12:10:14 +0200 Message-ID: <501BA386.3020804@wxs.nl> References: <501A9CCB.1010400@wanadoo.fr> <501B714F.8090003@wanadoo.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1343988627 19930 80.91.229.3 (3 Aug 2012 10:10:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Aug 2012 10:10:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 03 12:10:25 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SxEpt-0008G2-DN for gctc-ntg-context-518@m.gmane.org; Fri, 03 Aug 2012 12:10:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 49755101DD; Fri, 3 Aug 2012 12:10:24 +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 HxHSm7q-wH8C; Fri, 3 Aug 2012 12:10:22 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8BB01101DF; Fri, 3 Aug 2012 12:10:22 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 119AD101DF for ; Fri, 3 Aug 2012 12:10:21 +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 E-ntFrnlLJbT for ; Fri, 3 Aug 2012 12:10:20 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 25936101DD for ; Fri, 3 Aug 2012 12:10:20 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q73AAI0C010907 for ; Fri, 3 Aug 2012 12:10:19 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 6.1c) with ESMTP (TLS) id 1396-1713362 for multiple; Fri, 03 Aug 2012 12:10:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <501B714F.8090003@wanadoo.fr> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=03; city=Hattem; latitude=52.4724; longitude=6.0696; http://maps.google.com/maps?q=52.4724,6.0696&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VHGaai4J - 86894d77729f - 20120803 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:77721 Archived-At: On 3-8-2012 08:35, Olivier Binda wrote: > On 02/08/2012 17:43, Aditya Mahajan wrote: >> On Thu, 2 Aug 2012, Olivier Binda wrote: >> >>> 1) does lxml.att("#1","some tag") really work ? >> >> I don't know, but please provide a complete minimal example. > \startxmlsetups xml:test > \xmlsetsetup{maths}{c}{xml:*} > \stopxmlsetups > \xmlregistersetup{xml:test} > \startxmlsetups xml:c > \ctxlua{ > title = "test="..lxml.att("#1","title") > context(title)}% > \stopxmlsetups > > \starttext > test : \xmlprocessdata {maths}{ title="My title">} {} > \stoptext > \endinput > > Context gives the "can't concatenate with a nil value" Luatex error > when processing this snipet...but if I ignore the error, the pdf output > is okey the functions in the lxml namespace already print to context and return no value so you effectively appends nil which is invalid also, when used in a context run the default serializer is also piping to context so if you want otherwise you need to prefix with xml:// (which is an indication that in principle there can be many variants) here are some valid solutions (whatch the lxml.id): \startxmlsetups xml:test \xmlsetsetup{#1}{c}{xml:*} \stopxmlsetups \xmlregistersetup{xml:test} \startxmlsetups xml:c \ctxlua{title = "test=" .. xml.filter(lxml.id("#1"),"xml://./attribute(title)") context(title)} \par \ctxlua{context("test=") xml.filter(lxml.id("#1"),"./attribute(title)")} \par \ctxlua{context("test=") lxml.att("#1","title")} \stopxmlsetups \starttext \xmlprocessdata {maths} {} {} \stoptext You can wikify this ... Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / 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 ___________________________________________________________________________________