From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/57100 Path: news.gmane.org!not-for-mail From: Hans van der Meer Newsgroups: gmane.comp.tex.context Subject: do not understand \xmlindex Date: Sun, 14 Mar 2010 22:53:26 +0100 Message-ID: <82E06E33-9DB6-4CC7-B109-23D65A0B7DCE@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============0780968745==" X-Trace: dough.gmane.org 1268603622 26516 80.91.229.12 (14 Mar 2010 21:53:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 14 Mar 2010 21:53:42 +0000 (UTC) To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 14 22:53:38 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 1Nqvkg-0000Ne-7h for gctc-ntg-context-518@m.gmane.org; Sun, 14 Mar 2010 22:53:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 34873C9C38; Sun, 14 Mar 2010 22:53:37 +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 PmnNkfHGIEct; Sun, 14 Mar 2010 22:53:34 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 444BDC9C91; Sun, 14 Mar 2010 22:53:34 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CFB21C9C91 for ; Sun, 14 Mar 2010 22:53:31 +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 WQ7QAmXQ3fxl for ; Sun, 14 Mar 2010 22:53:28 +0100 (CET) Original-Received: from smtp-vbr18.xs4all.nl (smtp-vbr18.xs4all.nl [194.109.24.38]) by balder.ntg.nl (Postfix) with ESMTP id 6E063C9C38 for ; Sun, 14 Mar 2010 22:53:27 +0100 (CET) Original-Received: from [192.168.178.23] (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by smtp-vbr18.xs4all.nl (8.13.8/8.13.8) with ESMTP id o2ELrQZx020913 for ; Sun, 14 Mar 2010 22:53:26 +0100 (CET) (envelope-from H.vanderMeer@uva.nl) X-Mailer: Apple Mail (2.936) X-Virus-Scanned: by XS4ALL Virus Scanner 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:57100 Archived-At: --===============0780968745== Content-Type: multipart/alternative; boundary=Apple-Mail-1-386114021 --Apple-Mail-1-386114021 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit I do not understand the behaviour of \xmlindex in the code below. The goal is to extract the contents of node -number 1. The strange things is that \xmltext returns the contents of both the nodes, but \xmlindex returns nothing. The returns of the \writestatus calls: >>1>> ab-2 : :: >>2>> ab-2 : :ABC-1ABC-2: \startxmlsetups xml:testsetups \xmlsetsetup{test}{test|ab|abc}{xml:*} \stopxmlsetups \xmlregistersetup{xml:testsetups} \startxmlsetups xml:test \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:ab \writestatus{>>1>> \xmltag{#1}-\xmlcount{#1}{/abc}}{:\xmlindex{#1}{/ abc}{1}:} \writestatus{>>2>> \xmltag{#1}-\xmlcount{#1}{/abc}}{:\xmltext{#1}{/ abc}:} \stopxmlsetups \starttext \xmlprocessfile{test}{test.xml}{} \stoptext Input is: ABC-1 ABC-2 Hans van der Meer --Apple-Mail-1-386114021 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I do not understand the = behaviour of \xmlindex in the code below. The goal is to extract the = contents of node <abc>-number 1. The strange things is that = \xmltext returns the contents of both the <abc> nodes, but = \xmlindex returns nothing.
The returns of the \writestatus = calls:
>>1>> = ab-2        : ::


\startxmlsetups = xml:testsetups
= \xmlsetsetup{test}{test|ab|abc}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:testsetups}

\startxm= lsetups xml:test
= \xmlflush{#1}
\stopxmlsetups

\st= artxmlsetups xml:ab
\writestatus{>>1>> = \xmltag{#1}-\xmlcount{#1}{/abc}}{:\xmlindex{#1}{/abc}{1}:}
= \writestatus{>>2>> = \xmltag{#1}-\xmlcount{#1}{/abc}}{:\xmltext{#1}{/abc}:}
\stopxmls= etups

\starttext
\xmlprocessfile{test}{= test.xml}{}
\stoptext

Input = is:
<test>
<ab>
= <abc>ABC-1</abc>
= <abc>ABC-2</abc>
= </ab>
</test>