From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115030 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Hothersall via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: XML Namespaces and XML Setups Date: Mon, 23 May 2022 09:07:51 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1966754391951134239==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39847"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Duncan Hothersall To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon May 23 10:09:02 2022 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 1nt37e-000A2n-GX for gctc-ntg-context-518@m.gmane-mx.org; Mon, 23 May 2022 10:09:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 828A1289E25; Mon, 23 May 2022 10:08:17 +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 qdgTwGozpxSl; Mon, 23 May 2022 10:08:15 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6D90B289FC6; Mon, 23 May 2022 10:08:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 273E1289F51 for ; Mon, 23 May 2022 10:08:14 +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 o7Yhl_UACOnJ for ; Mon, 23 May 2022 10:08:11 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.171; helo=mail-lj1-f171.google.com; envelope-from=dh@capdm.com; receiver= Original-Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 13425289E25 for ; Mon, 23 May 2022 10:08:10 +0200 (CEST) Original-Received: by mail-lj1-f171.google.com with SMTP id a23so16220467ljd.9 for ; Mon, 23 May 2022 01:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=capdm.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gq60GAVqZ1d2xCEzchvwiBpG/4l0DSxHI5of95vU28s=; b=gUJV9z8UAp6JkJhJFQYIc/A2EW7J1BAmfOt+YmSkBGwHldN4w2eId8iInEgfqvFLp8 2+eRpm8kOSEqIh21PcdLczZntchHusJNKlGL3FbyCdsp3HEzwc/fh85so6oihRHH/iqi cQTgqR17RxVkmHe+U577Vr+8hdK4J5E5kCZzk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gq60GAVqZ1d2xCEzchvwiBpG/4l0DSxHI5of95vU28s=; b=qM4vW4vQm8bCAMJI8hpUdjyJl3vdo5kSm0uzZenWC82dkSc07OB4ACpQSIc2NFfVZO V1VHer0JF+nGBq1e4qc3sQYN7AUIEZhD289MRkDwIg9AFNYfXg+5ScrTJn++RBYU6Gvg w1FMiDQT7IEyq1nUs28BUVz31MknVpKxEURdTMNsaPq/nil09IgMioUat5aUTEEOI7EA k+/H5+zUcUVdGAWwkRfhIwwTBEGHye7jfVMYWjeapIeb8wTuoR0qvODEhlHeI8ExrCZ0 2dbiS77I6w0Pv6m7zBH/D4bcmYzoSTRBVSWY3PUTfV3COhZOrH3TpjEnDxpQzHZl4Z+c tqIQ== X-Gm-Message-State: AOAM5335AqKbK0vL+Zclwoo20ESIjTQMx8z6j1Eu8i72wLZ/s4GfB/ig ZsB3NSRK05/wEttHxBGeI56CmiWr+We+NYvbEQWCn/IR9ywLaQ== X-Google-Smtp-Source: ABdhPJyZX948jcCIWHf4e/4gVkRrRXu6Sml39tk0qAQQK8dEtW9NG7HhIVpI2hX0ZQmF0I+1eQ/9/14+rJagZrreXSo= X-Received: by 2002:a2e:3a10:0:b0:253:e72d:2749 with SMTP id h16-20020a2e3a10000000b00253e72d2749mr4140361lja.259.1653293288718; Mon, 23 May 2022 01:08:08 -0700 (PDT) In-Reply-To: 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:115030 Archived-At: --===============1966754391951134239== Content-Type: multipart/alternative; boundary="0000000000002f200a05dfa9577d" --0000000000002f200a05dfa9577d Content-Type: text/plain; charset="UTF-8" I found this unanswered question on the list from November 2020 and find today that I have the same question. How can one handle elements with the same name but in different namespaces? How should the different \startxmlsetups commands be written? Thanks. Duncan On Mon, 16 Nov 2020 at 13:37, Christoph Reller wrote: > Dear List, > > Consider the following MWE: > > \startxmlsetups xml:demo:base > \xmlsetsetup{#1}{tag}{xml:demo:tag} > \stopxmlsetups > \xmlregisterdocumentsetup{demo}{xml:demo:base} > \startxmlsetups xml:demo:tag > %\doif{\xmlnamespace{#1}}{o}{NameSpaceO:} > \xmlflush{#1} > \stopxmlsetups > \starttext > \startbuffer[test] > > xmlns:o="NameSpaceO"> > text text > > \stopbuffer > \xmlprocessbuffer{demo}{test}{} > \stoptext > > My questions: > - Is there a good way to have a separate XML setup for each XML namespace? > - Alternatively, one has to do the distinction within the same XML setup. > In this case, how do we get the complete namespace? (In this example: > "NameSpaceA" and "NameSpaceO") > > Thanks in advance for your help! > > Cheers, Christoph > > ___________________________________________________________________________________ > 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 > > ___________________________________________________________________________________ > --0000000000002f200a05dfa9577d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I found this unanswered question on the list from Nov= ember 2020 and find today that I have the same question. How can one handle= elements with the same name but in different namespaces? How should the di= fferent \startxmlsetups commands be written?

Thank= s.

Duncan

On Mon, 16 Nov 2020 at 13:37, Christoph R= eller <christoph.reller@gm= ail.com> wrote:
Dear List,

Consider the followin= g MWE:

\startxmlsetups xml:demo:base
=C2=A0 \xm= lsetsetup{#1}{tag}{xml:demo:tag}
\stopxmlsetups
\xmlregisterdocuments= etup{demo}{xml:demo:base}
\startxmlsetups xml:demo:tag
=C2=A0 %\doif{= \xmlnamespace{#1}}{o}{NameSpaceO:}
=C2=A0 \xmlflush{#1}
\stopxmlsetup= s
\starttext
\startbuffer[test]
<?xml version=3D"1.0"= ?>
<root xmlns=3D"NameSpaceA"
=C2=A0 =C2=A0 =C2=A0 xm= lns:o=3D"NameSpaceO">
=C2=A0 <tag>text</tag> &l= t;o:tag>text</o:tag>
</root>
\stopbuffer
\xmlproces= sbuffer{demo}{test}{}
\stoptext

My question= s:
- Is there a good way to have a=C2=A0separate=C2=A0XML setup f= or each XML namespace?
- Alternatively, one has to do the distinc= tion within the same XML setup. In this case, how do we get the complete na= mespace? (In this example: "NameSpaceA" and "NameSpaceO"= ;)

Thanks in advance for=C2=A0your help!

Cheers, Christoph
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________


--0000000000002f200a05dfa9577d-- --===============1966754391951134239== 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== --===============1966754391951134239==--