From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/57139 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: xmlindex getting attributes and more Date: Mon, 15 Mar 2010 22:34:17 +0100 Message-ID: <4B9EA7D9.60305@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1268688881 5555 80.91.229.12 (15 Mar 2010 21:34:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 15 Mar 2010 21:34:41 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 15 22:34:35 2010 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 1NrHvm-0004p5-PZ for gctc-ntg-context-518@m.gmane.org; Mon, 15 Mar 2010 22:34:34 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97F57C9CDA; Mon, 15 Mar 2010 22:34:34 +0100 (CET) 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 W2SdOr1Ef1Ae; Mon, 15 Mar 2010 22:34:31 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C18EDC9C44; Mon, 15 Mar 2010 22:34:31 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E77FBC9C44 for ; Mon, 15 Mar 2010 22:34:29 +0100 (CET) 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 yB-2jtBjia4Y for ; Mon, 15 Mar 2010 22:34:27 +0100 (CET) Original-Received: from mail.solcon.net (unknown [217.121.8.199]) by balder.ntg.nl (Postfix) with ESMTP id BAEBDC9C40 for ; Mon, 15 Mar 2010 22:34:27 +0100 (CET) X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.194; Original-Received: from [10.100.1.194] (unverified [10.100.1.194]) by controller-9 (SurgeMail 4.2d2) with ESMTP id 3106-1713362 for multiple; Mon, 15 Mar 2010 22:33:56 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 In-Reply-To: X-Authenticated-User: hagen@controller-9 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:57139 Archived-At: On 15-3-2010 22:26, Hans van der Meer wrote: > (1) How does one retrieve an attribute from an element collected with > \xmlindex{node{lpath}{n}? > > (2) I don't understand in xml:test \xmlcount{#1}{} giving 1 for an answer, > whereas \xmlcount{#1}{*} and \xmlcount{#1}{/abc} yield 2 as is expected. because {} is not {*} but basically self > (3) With the code below \xmlindex starts looping on an empty lpath, > whereas like \xmltext{} react without problem. > Problem is showed by \xmlindex, \xmlfirst, \xmllast, \xmlall, \xmlconcat > Behaviour is not shown by \xmltext{node}{}, \xmlstripped, \xmlstrip > Is this a bug in \xmlindex's underlying lua? > > ! TeX capacity exceeded, sorry [text input levels=127]. > \xmlindex ...ua {lxml.index("#1","#2",\number #3)} > \@@su:xml:test #1->test:\xmlindex {#1}{}{1} > \par > l.7 } > \xmlindex ...ua {lxml.index("#1","#2",\number #3)} > \@@su:xml:test #1->test:\xmlindex {#1}{}{1} > \par > > \startxmlsetups xml:testsetups > \xmlsetsetup{test}{test|abc}{xml:*} > \stopxmlsetups > \xmlregistersetup{xml:testsetups} > > \startxmlsetups xml:test > test:\xmlindex{#1}{}{1}\par % << empty lpath fails > \stopxmlsetups why do you use xmlindex in this case you could use \xmlfirst{#1} or \xmlfilter{#1}{[position()=1]} (I will probably rewrite xmlindex as it's a leftover) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 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 ___________________________________________________________________________________