From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/105336 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Geert Verhaag Newsgroups: gmane.comp.tex.context Subject: How to get attribute value from xml tag? Date: Sun, 20 Oct 2019 16:05:06 +0200 Message-ID: <4629b3dc-ce28-dbdc-c1e6-bdc265ac0d28@ziggo.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2146786284947679748==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="60684"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 20 16:05:41 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iMBq1-000Fe8-2l for gctc-ntg-context-518@m.gmane.org; Sun, 20 Oct 2019 16:05:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3CC62161CB3; Sun, 20 Oct 2019 16:05:16 +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 iURp9OSgYcqq; Sun, 20 Oct 2019 16:05:15 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 64FB1161FD1; Sun, 20 Oct 2019 16:05:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 86E61161FCF for ; Sun, 20 Oct 2019 16:05:13 +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 jn9QpZrepuWY for ; Sun, 20 Oct 2019 16:05:13 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.54.42.166; helo=smtpq3.tb.mail.iss.as9143.net; envelope-from=verhaaggchm@ziggo.nl; receiver= Original-Received: from smtpq3.tb.mail.iss.as9143.net (smtpq3.tb.mail.iss.as9143.net [212.54.42.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 09814161CB3 for ; Sun, 20 Oct 2019 16:05:12 +0200 (CEST) Original-Received: from [212.54.42.110] (helo=smtp7.tb.mail.iss.as9143.net) by smtpq3.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iMBpY-0004Wf-Rf for ntg-context@ntg.nl; Sun, 20 Oct 2019 16:05:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ziggo.nl; s=201809corplgsmtpnl; h=MIME-Version:Date:Message-ID:Subject:From:To; bh=DXmobivacbJlrKgWTJ2jsvvixSdn6Z7tx+1ZCjvnwqI=; b=nGmXqyKxsrJpQ6F7OS0dvTCeb9 h8vIGA4MpAkA6fVtdzZq5ymqQqQgH1rwCIAm/4HMR6lx2Zuw0LFdv7EcZ3k7oMZfMlX7KY6JGLH+3 2JDbODjR2TnX+gn549DrXdg/ze4yJ6OAksdg0+1xVObFwJbLKeuPfy53mnQUhzylCDxRyDJmKI6zl YjJ9+FbpSj/DYWIEaJfeNp2O5j/yyed4T1cF7FuB7BiCG8ybF0p8ueU3mILomqEz/L0Ys3/qc1AKh FTHL1QAxC1rCib5DPsj37oFuS6l8lvaQAV8jn11vSUmb2Z48ovUaV5ORPz9JloasYgP0Unj/Qlev+ PPwNPk8g==; Original-Received: from 217-62-232-191.cable.dynamic.v4.ziggo.nl ([217.62.232.191]) by smtp7.tb.mail.iss.as9143.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1iMBpY-00066b-N3 for ntg-context@ntg.nl; Sun, 20 Oct 2019 16:05:12 +0200 Content-Language: en-US X-SourceIP: 217.62.232.191 X-Authenticated-Sender: verhaaggchm@ziggo.nl (via SMTP) X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.3 cv=M/Qz1B4s c=1 sm=1 tr=0 a=k1DxAyE6XBYMsoVc9N9uQg==:17 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=XobE76Q3jBoA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=zjppiTdPLwbxL_dD4ikA:9 a=QEXdDO2ut3YA:10 a=YyZxCotXMojp__Nq0BAA:9 a=0BoUVFff7lf5DpUh:21 a=_W_S_7VecoQA:10 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 X-Ziggo-Spam-Status: No 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.org gmane.comp.tex.context:105336 Archived-At: This is a multi-part message in MIME format. --===============2146786284947679748== Content-Type: multipart/alternative; boundary="------------7A12FEC2C1D68073598CED6B" Content-Language: en-US This is a multi-part message in MIME format. --------------7A12FEC2C1D68073598CED6B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Struggling with XML in ConTeXt. I'have the following tag in my xml file: ...       20   ... \startxmlsetups xml:invoice:travel   \xmlfirst{#1}{distance} \stopxmlsetups The \xmlfirst{#1}{distance} yields /20/, but how can the unit attribute value /km/ be accessed? Gerard -- --------------7A12FEC2C1D68073598CED6B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi,

Struggling with XML in ConTeXt.

I'have the following tag in my xml file:

...
<invoice>
  <travel>
    <distance unit="km">20</distance>
  </travel>
...
</invoice>

\startxmlsetups xml:invoice:travel
  \xmlfirst{#1}{distance}
\stopxmlsetups

The \xmlfirst{#1}{distance} yields 20, but how can the unit attribute value km be accessed?

Gerard

--


--------------7A12FEC2C1D68073598CED6B-- --===============2146786284947679748== 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== --===============2146786284947679748==--