From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86443 Path: news.gmane.org!not-for-mail From: "Birke, Gabriel" Newsgroups: gmane.comp.tex.context Subject: Accessing current XML node in Lua function Date: Tue, 25 Feb 2014 11:13:32 +0100 Message-ID: <8E06A518ABC4234792C6DC75D065F2B00E53E457@nts3040.tib.uni-hannover.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1393323223 5189 80.91.229.3 (25 Feb 2014 10:13:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Feb 2014 10:13:43 +0000 (UTC) To: "'ntg-context@ntg.nl'" Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 25 11:13:53 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WIF1L-0007mU-M2 for gctc-ntg-context-518@m.gmane.org; Tue, 25 Feb 2014 11:13:51 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C2F82101E3; Tue, 25 Feb 2014 11:13:50 +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 G7jjCWmVySQJ; Tue, 25 Feb 2014 11:13:48 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8FC91101E8; Tue, 25 Feb 2014 11:13:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DE52F101E8 for ; Tue, 25 Feb 2014 11:13:46 +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 onAUKuZrF+3v for ; Tue, 25 Feb 2014 11:13:45 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 48814101E3 for ; Tue, 25 Feb 2014 11:13:35 +0100 (CET) Original-Received: from nts3040.tib.uni-hannover.de (nts3040.tib.uni-hannover.de [194.95.113.40]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s1PADXUN015964 for ; Tue, 25 Feb 2014 11:13:34 +0100 Original-Received: by nts3040.tib.uni-hannover.de with Internet Mail Service (5.5.2657.72) id ; Tue, 25 Feb 2014 11:13:32 +0100 X-Mailer: Internet Mail Service (5.5.2657.72) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=194.95.113.40; country=DE; region=06; city=Hanover; latitude=52.3667; longitude=9.7167; http://maps.google.com/maps?q=52.3667,9.7167&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TLuydyoQ - c64b2ef48fdd - 20140225 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:86443 Archived-At: Hi, I'd like to write a Lua function that processes the href attribute from a HTML file and outputs different content depending on the URL. However, I don't know how to convert the XML attribute and the contents of the link tag to a string value for the Lua function. I've tried the following, which does not work but makes my intention clearer: \startxmlsetups xml:a \directlua{getlinkcode("\\xmlatt{#1}{href}", "\\xmlflush{#1}")} \stopxmlsetups It's probably calls to lxml.att and lxml.flush instead of the strings, but how do I convert the "#1" ? Kind regards, Gabriel -- Gabriel Birke Open Science Lab Technische Informationsbibliothek / German National Library of Science and Technology Welfengarten 1 B, 30167 Hannover, Germany Telefon: +49 511 762 14235 E-Mail: gabriel.birke@tib.uni-hannover.de Internet: http://www.tib.uni-hannover.de ___________________________________________________________________________________ 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 ___________________________________________________________________________________