From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61957 Path: news.gmane.org!not-for-mail From: Jano Kula Newsgroups: gmane.comp.tex.context Subject: index: xml in mkiv Date: Sat, 25 Sep 2010 16:24:08 +0200 Message-ID: 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 1285424899 20979 80.91.229.12 (25 Sep 2010 14:28:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 14:28:19 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sat Sep 25 16:28:18 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 1OzVja-00027H-BG for gctc-ntg-context-518@m.gmane.org; Sat, 25 Sep 2010 16:28:14 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BE488CA708; Sat, 25 Sep 2010 16:28:13 +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 tpIhfJHhzW+v; Sat, 25 Sep 2010 16:28:07 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5F38BCA702; Sat, 25 Sep 2010 16:28:07 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A995BCA702 for ; Sat, 25 Sep 2010 16:28:05 +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 OmPqR47tBt-n for ; Sat, 25 Sep 2010 16:27:54 +0200 (CEST) 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 E0DD3CA701 for ; Sat, 25 Sep 2010 16:27:53 +0200 (CEST) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8PERqoi019448 for ; Sat, 25 Sep 2010 16:27:53 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OzVjE-0001nx-DQ for ntg-context@ntg.nl; Sat, 25 Sep 2010 16:27:52 +0200 Original-Received: from 249.39.broadband10.iol.cz ([90.177.39.249]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Sep 2010 16:27:52 +0200 Original-Received: from jano.kula by 249.39.broadband10.iol.cz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Sep 2010 16:27:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 150 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 249.39.broadband10.iol.cz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100720 Lanikai/3.1.1 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.12; country=NO; region=12; city=Oslo; latitude=59.9167; longitude=10.7500; http://maps.google.com/maps?q=59.9167,10.7500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0bDb2rQxA - d5110bf0bd1a - 20100925 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:61957 Archived-At: Hello Hans, just to remind the other issues. The code from xml-mkiv.pdf doesn't work as expected. Only in \TestMode=2 the index is rendered as supposed. demo.tex + demo.xml below Jano %%%%%%%%%% % demo.tex \newcount\TestMode \TestMode=0 % expansion=xml %\TestMode=1 % expansion=yes, index, setup %\TestMode=2 % expansion=yes \startxmlsetups xml:mysetups \xmlsetsetup{\xmldocument}{demo|index|content|chapter|title|em}{xml:*} \stopxmlsetups \xmlregistersetup{xml:mysetups} % main document \startxmlsetups xml:demo \xmlflush{#1} \subject{contents} \placelist[chapter][criterium=all] \subject{index} \placeregister[index][criterium=all] \page % else buffer is forgotten when placing header \stopxmlsetups \startxmlsetups xml:chapter \ifcase \TestMode % xml code travels around \setuphead[chapter][expansion=xml] \startchapter[title=eh: \xmltext{#1}{title}] \or % index is used for access via setup \setuphead[chapter][expansion=yes,xmlsetup=xml:title:flush] \startchapter[title=\xmlgetindex{#1}] \or % tex call to xml using index is used \setuphead[chapter][expansion=yes] \startchapter[title=hm: \xmlreference{#1}{xml:title:flush}] \fi \xmlfirst{#1}{content} \stopchapter \stopxmlsetups \startxmlsetups xml:title:flush \xmltext{#1}{title} \stopxmlsetups % We need to deal with emphasis and the content of the chapter. \startxmlsetups xml:em \begingroup\em\xmlflush{#1}\endgroup \stopxmlsetups \startxmlsetups xml:content \xmlflush{#1} \stopxmlsetups %A similar approach is followed with the index entries. Watch how we use the numbered entries variant (in this case we could also have used just entries and keys. \startxmlsetups xml:index \ifcase \TestMode \setupregister[index][expansion=xml,xmlsetup=] \setstructurepageregister [index] [entries:1=\xmlfirst{#1}{content}, keys:1=\xmltext{#1}{key}] \or \setupregister[index][expansion=yes,xmlsetup=xml:index:flush] \setstructurepageregister [index] [entries:1=\xmlgetindex{#1}, keys:1=\xmltext{#1}{key}] \or \setupregister[index][expansion=yes,xmlsetup=] \setstructurepageregister [index] [entries:1=\xmlreference{#1}{xml:index:flush}, keys:1=\xmltext{#1}{key}] \fi \stopxmlsetups \startxmlsetups xml:index:flush \xmlfirst{#1}{content} \stopxmlsetups % The file is processed by: \starttext \xmlprocessfile{main}{demo.xml}{} \stoptext % additional control %\startxmlsetups xml:ctx:sectionentry %\xmlflush{#1} %\stopxmlsetups %\startxmlsetups xml:ctx:registerentry %\xmlflush{#1} %\stopxmlsetups %%%%%%%%%% % demo.xml Some <em>short</em> title zeta zeta zeta again alpha alpha alpha again gamma gamma gamma beta beta beta delta delta delta done! ___________________________________________________________________________________ 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 ___________________________________________________________________________________