From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/107148 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: Reverse traversing of xml.collected()? Date: Fri, 1 May 2020 11:31:41 +0200 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="===============2348943611820013413==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="66550"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri May 01 11:32:16 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jUS1o-000HDZ-5T for gctc-ntg-context-518@m.gmane-mx.org; Fri, 01 May 2020 11:32:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 09C99182A22; Fri, 1 May 2020 11:31:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b-59qpsTHO32; Fri, 1 May 2020 11:31:44 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1DA5918238E; Fri, 1 May 2020 11:31:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 18ED518238E for ; Fri, 1 May 2020 11:31:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2d39ZXioDUhk for ; Fri, 1 May 2020 11:31:42 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 842EF181A73 for ; Fri, 1 May 2020 11:31:42 +0200 (CEST) Original-Received: from hermione.rna.nl (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id 01CDF3DF6D8D for ; Fri, 1 May 2020 11:31:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1588325502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=UBzVDLmlnFse989AnOTHetLnUAG4yYSgw5sJin0p6+Q=; b=XuYUQ2Iptnzt8v1uDedyEvgZOxN42X6vuKPo1CDtk3tEe7OrMntdycLFO9+8kLjLOZ8dGj 3byPp8Mq1m+2kdM84UCHyDA20BDX5SdP5uRU1aFE53zIh3RIWQXtCalSJH8rHvcaCl4K78 3RuUvLzgDY1N7+klj8ySstQoQQcRAW05Kgwb1AKNbIRitP+6i7NrgjdX/fDTahoeIhL42U zWFm37eCI/RHE4/CdguN3lISEdRqJ5xiqKOz2IWqXMJNQe6yxeN97WnYEBcmyByMj52WH+ WXQuiru4JuJ9K/6F0lGTTVgKZom0WU9FLk8aBskz3BGLgPEmGeIOylNlEl8Eqw== X-Mailer: Apple Mail (2.3445.104.14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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" Xref: news.gmane.io gmane.comp.tex.context:107148 Archived-At: --===============2348943611820013413== Content-Type: multipart/alternative; boundary="Apple-Mail=_B723B0E2-A081-4911-A432-DA884576CFC6" --Apple-Mail=_B723B0E2-A081-4911-A432-DA884576CFC6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I=E2=80=99d like to travese the contents of an xml.collected() in a = reverse order. I have for connectionFromXML in xml.collected(viewFromXML,"/connection") do parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, = rootFromOverrideXML) end I tried: local relationTable =3D xml.collected(viewFromXML,"/connection") for i=3D#relationTable, 1, -1 do connectionFromXML =3D relationTable[i] parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, = rootFromOverrideXML) end But apparently my lua knowledge is lacking (severely, I might say) as = this ends with =E2=80=9Cattempt to get length of a function value =E2=80=9C= What is the correct way to do it? G= --Apple-Mail=_B723B0E2-A081-4911-A432-DA884576CFC6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I=E2=80= =99d like to travese the contents of an xml.collected() in a reverse = order. I have

    for = connectionFromXML in xml.collected(viewFromXML,"/connection") = do
    =   parseXMLConnection( rootFromXML, connectionFromXML, viewFromXML, = rootFromOverrideXML)
    end

I tried:

    local relationTable =3D = xml.collected(viewFromXML,"/connection")
    for i=3D#relationTable, 1, -1 = do
    =   connectionFromXML =3D relationTable[i]
      parseXMLConnection( = rootFromXML, connectionFromXML, viewFromXML, = rootFromOverrideXML)
    end

But = apparently my lua knowledge is lacking (severely, I might say) as this = ends with =E2=80=9Cattempt to get length of a function value =E2=80=9C

What is the correct way to do = it?

G
= --Apple-Mail=_B723B0E2-A081-4911-A432-DA884576CFC6-- --===============2348943611820013413== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2348943611820013413==--