From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110585 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: Re: Question about parsing XML and attributes (normally var.at.attrib) with a name with ':' in it Date: Sun, 14 Feb 2021 23:11:55 +0100 Message-ID: <07188C1B-A887-4F57-A303-09465B8E6298@rna.nl> References: <417D24C8-7EA0-4F38-8CE3-E8267CC28CD2@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Content-Type: multipart/mixed; boundary="===============3553502004308033915==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30243"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 14 23:12:28 2021 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 1lBPcy-0007ki-7p for gctc-ntg-context-518@m.gmane-mx.org; Sun, 14 Feb 2021 23:12:28 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2E1A72807E4; Sun, 14 Feb 2021 23:12:00 +0100 (CET) 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 ZH0D5vSXu_52; Sun, 14 Feb 2021 23:11:58 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1BEE22807F0; Sun, 14 Feb 2021 23:11:58 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D4AAB2800E9 for ; Sun, 14 Feb 2021 23:11:57 +0100 (CET) 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 GWVxXLSdxHbw for ; Sun, 14 Feb 2021 23:11:57 +0100 (CET) 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 E599A2800A0 for ; Sun, 14 Feb 2021 23:11:56 +0100 (CET) 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 9DD138264D29 for ; Sun, 14 Feb 2021 23:11:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1613340715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x4tiELSihm3dsXC09Bx1aKVd7wfqr/W2nirXSgV4BzU=; b=orvNoI+NJhdYwO4J/hPkRNQz3oqWVIMfcffs/WJT+GSl0BRLbbuurP0b+Q3aobWp8Ei9Mf 2o02Po/njCPaBGM7cfUzjFIM06PyHjWNcNN9GbeyWvbaSf+RUyj5a8NMLwkjh9qnbe0apS xrTA3l+SkiXm11qAGc2n2uouHvw8ALqc0bYcYw7rIaqwiwKHPiwlReuCTxpiGbYQO3RbGy xxIpHnNB0Zmo5Mk+qYuYcPwe/SLDruzmC2Vu3hbu11WSTxhzy8fGsCjZ0y/cece9HMClKR Wa96TvzxYLn7T+jYvIj4iGG5pmDDGp6A4Lf/l7AxUH8tN6MZFqWqf1466oxdjA== In-Reply-To: <417D24C8-7EA0-4F38-8CE3-E8267CC28CD2@rna.nl> X-Mailer: Apple Mail (2.3608.120.23.2.4) 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:110585 Archived-At: --===============3553502004308033915== Content-Type: multipart/alternative; boundary="Apple-Mail=_D7713922-7C51-4D39-BD9B-7D3F7FE66DC0" --Apple-Mail=_D7713922-7C51-4D39-BD9B-7D3F7FE66DC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 foo.at[=E2=80=9Cattribute:B=E2=80=9D] I looked at the code and guessed this. Still haven=E2=80=99t found = really good documentation for lua, lua in ConTeXt, and especially theXML = stuff (it=E2=80=99s all written as \xmlsomething TeX commands. No idea = if this is ConTeXt, lua or whatever but it works. Gerben Wierda (LinkedIn ) R&A Enterprise Architecture (main site) Book: Chess and the Art of Enterprise=C2=A0Architecture = Book: Mastering ArchiMate > On 14 Feb 2021, at 22:40, Gerben Wierda wrote: >=20 > If I have an XML element like this: >=20 > >=20 > and it has been read in a lua variable foo, I can get at attribute x = with foo.at .x=20 >=20 > But how do I get at attribute:B? >=20 > Gerben Wierda (LinkedIn ) > R&A Enterprise Architecture (main site) > Book: Chess and the Art of Enterprise=C2=A0Architecture = > Book: Mastering ArchiMate >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / = http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > = __________________________________________________________________________= _________ --Apple-Mail=_D7713922-7C51-4D39-BD9B-7D3F7FE66DC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
foo.at[=E2=80=9Cattribute:B=E2=80=9D]

I looked at the code and = guessed this. Still haven=E2=80=99t found really good documentation for = lua, lua in ConTeXt, and especially theXML stuff (it=E2=80=99s all = written as \xmlsomething TeX commands. No idea if this is ConTeXt, lua = or whatever but it works.


On 14 Feb 2021, at 22:40, Gerben Wierda <gerben.wierda@rna.nl> wrote:

If I = have an XML element like this:

<A x=3D=E2=80=9Cone=E2=80=9D = attribute:B=3D=E2=80=9Ctwo"/>

and it has been read in a lua variable = foo, I can get at attribute x with foo.at.x 

But how do I get at = attribute:B?


_________________________________________________________= __________________________
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://context.aanhet.net
archive  : = https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
_______________________________________________________________= ____________________

= --Apple-Mail=_D7713922-7C51-4D39-BD9B-7D3F7FE66DC0-- --===============3553502004308033915== 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== --===============3553502004308033915==--