From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71330 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: xml processing in lua Date: Mon, 26 Sep 2011 15:15:09 -0400 (EDT) Message-ID: References: <4E80CB15.4070709@uni-bonn.de> 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 1317064493 12283 80.91.229.12 (26 Sep 2011 19:14:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 26 Sep 2011 19:14:53 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 26 21:14:49 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 1R8Gdc-00049V-GT for gctc-ntg-context-518@m.gmane.org; Mon, 26 Sep 2011 21:14:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 390C6CAFD7; Mon, 26 Sep 2011 21:14:43 +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 FWht+doIrwUr; Mon, 26 Sep 2011 21:14:42 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4E1CDCAFD2; Mon, 26 Sep 2011 21:14:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8F3A4CAFD2 for ; Mon, 26 Sep 2011 21:14:36 +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 9NHuWlVkQamB for ; Mon, 26 Sep 2011 21:14:34 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 8DDF9CAFD1 for ; Mon, 26 Sep 2011 21:14:34 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p8QJEWLK030593 for ; Mon, 26 Sep 2011 21:14:33 +0200 Original-Received: FROM [10.0.2.15] (web044042.Wireless.McGill.CA [142.157.44.42]) By tombraider.mr.itd.umich.edu ID 4E80CF16.D1734.13600 ; Authuser adityam; 26 Sep 2011 15:14:30 EDT In-Reply-To: <4E80CB15.4070709@uni-bonn.de> User-Agent: Alpine 2.02 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0dFBvew3m - 1a73b33563e3 - 20110926 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:71330 Archived-At: On Mon, 26 Sep 2011, Thomas A. Schmitz wrote: > Hi all, > > after boring people with xml processing in TeX at the meeting in Bassenge, > I'm looking for new challenges and am trying my hand at processing xml in > lua. But so far, even the simplest things escape me. Here's an example: > > \startbuffer[test] > > One > Two > > \stopbuffer > > \startxmlsetups xml:setups > \xmlsetsetup{main}{a|b|c}{xml:*} > \stopxmlsetups > > \xmlregistersetup{xml:setups} > > % \startxmlsetups xml:a > % \xmltext{#1}{/c} > % \stopxmlsetups > > \startxmlsetups xml:a > \startluacode > context(xml.text("#1", "/b")) > \stopluacode > \stopxmlsetups > > \starttext > \xmlprocessbuffer{main}{test}{} > \stoptext > > From what I thought I understood from the source, I believed that ll. 14-16 > (the commented part) and ll. 18-22 should be exactly equivalent, but that's > not the case. A little hint might get me started... Untested ... you can try context.xmltext("#1", "/b") Aditya ___________________________________________________________________________________ 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 ___________________________________________________________________________________