From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78227 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: xml cross-references in lua? Date: Tue, 11 Sep 2012 19:22:13 +0200 Message-ID: <504F7345.6050309@uni-bonn.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"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347384149 1775 80.91.229.3 (11 Sep 2012 17:22:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2012 17:22:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 11 19:22:31 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 1TBUAM-0001AY-An for gctc-ntg-context-518@m.gmane.org; Tue, 11 Sep 2012 19:22:26 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8D928101E6; Tue, 11 Sep 2012 19:22:22 +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 lbRxdWSGUylY; Tue, 11 Sep 2012 19:22:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 9F3DC101E9; Tue, 11 Sep 2012 19:22:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0761A101E9 for ; Tue, 11 Sep 2012 19:22:19 +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 TakBxkfOKHiz for ; Tue, 11 Sep 2012 19:22:18 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 2C0BF101E6 for ; Tue, 11 Sep 2012 19:22:18 +0200 (CEST) Original-Received: from uni-bonn.de (mail.uni-bonn.de [131.220.15.113]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q8BHKVNv013180 for ; Tue, 11 Sep 2012 19:20:32 +0200 Original-Received: from [87.178.42.79] (account tschmit1@uni-bonn.de HELO [192.168.0.20]) by fe2.uni-bonn.de (CommuniGate Pro SMTP 5.4.4) with ESMTPSA id 25292844 for ntg-context@ntg.nl; Tue, 11 Sep 2012 19:22:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 X-Bayes-Prob: 0.2962 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=131.220.15.113; country=DE; region=07; city=Bonn; latitude=50.7333; longitude=7.1000; http://maps.google.com/maps?q=50.7333,7.1000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WHVRkvRn - 92b3b65935c7 - 20120911 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 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:78227 Archived-At: Hi all, I have a question about xml processing and I think that what I want/need can best be achieved by using lua code, but so far, I'm not really sure how to proceed, so any help from one of the resident lua gurus would be welcome. So: the question. xml allows to provide elements with unique identifiers so that one can add cross-references within the document structure. Here is a sample xml file that shows what I mean: Hans Hagen The Meaning of Life Is 42 The Rhetoric of Mathematics 2011 Hans Hagen The New Meaning is Now 43 High Energy Metaphysics 2012

This has been successfully proven in papers by and .

[Note: the TEI guidelines add the hash character in the attribute value to such references, but after much googling, I'm still not sure if this is standard or necessary or bizarre.] So: at the point of the reference (which may be empty, like here, or contain text), I want to refer back to the bibitems. The typesetting engine should then be instructed to pick up the information, so that this is, e.g., typeset as "This has been successfully proven in papers by Hans Hagen (2011) and Hans Hagen (2012)." My idea: since the xml:id attributes must be unique across the document, it would be easiest to collect them into a lua table, with the xml:id as key, so their content could be accessed and typeset later. But unfortunately, I have no clue how to go about this... Could somebody provide a pointer? Thanks for your interest, if you've read this far! Thomas ___________________________________________________________________________________ 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 ___________________________________________________________________________________