From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115039 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: Tue, 24 May 2022 09:50:05 +0100 Message-ID: References: <2082AE8E-0195-4408-A32F-2B1C24D66B03@scorecrow.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3817007459534388256==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25213"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Duncan Hothersall , mailing list for ConTeXt users To: Bruce Horrocks Original-X-From: ntg-context-bounces@ntg.nl Tue May 24 10:51:05 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 1ntQFt-0006KF-H2 for gctc-ntg-context-518@m.gmane-mx.org; Tue, 24 May 2022 10:51:05 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 411C4289F49; Tue, 24 May 2022 10:50:29 +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 8wLKUQ4uiZGj; Tue, 24 May 2022 10:50:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C5DA5289FCE; Tue, 24 May 2022 10:50:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C9FA8289F49 for ; Tue, 24 May 2022 10:50:25 +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 06KwOxuR-pZN for ; Tue, 24 May 2022 10:50:24 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.173; helo=mail-lj1-f173.google.com; envelope-from=dh@capdm.com; receiver= Original-Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 4BCD8289EEA for ; Tue, 24 May 2022 10:50:24 +0200 (CEST) Original-Received: by mail-lj1-f173.google.com with SMTP id m6so20086922ljb.2 for ; Tue, 24 May 2022 01:50:24 -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=W6nRc8gRJS3JLbevyZB0l37L424XPyNSJlzZmOdw7Lo=; b=lhoFVPvqPsm+EGv3+K5cCjbrr+9RW4PttDF3GzzAEZrzk0EDUiyfoy63hnDaTzxhSf S/0SwyT6IGWGuaMx4etfY4QwuJwLNisWI6qd89sV1wiH6Cz+n0j514/Pe0HB3kxc8YW5 jz+6yMkIOPm3egIYP6iYM66lHQRhcLxqZNvw0= 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=W6nRc8gRJS3JLbevyZB0l37L424XPyNSJlzZmOdw7Lo=; b=fBYhRZXgo2SviqqX5gb5GuKmsGo+Vb0ZwEvxMEdUqWKBAUdqP/zLqBoymye32OVxDk HUWnV9iKidGwEWy+J8JRA+4f47mxhsoQWmPtqLwYVVzirQ+ZuMvoTTcwd9B1QbuFMNas Qt1UiwDku1wAVTABulVLrb3+4ccl5fmETUoeML0jk/dP5yVzUJM+clzQH4b5b3Sx5KAE HYVBLeywAtY0hMKozb/CUVUeHspyUmpECM1EngCtpHwIhzXqo1glfIa1N8xThTlJvyab UpAFAUxfkP0cXQo2saLEiRE2N7DNYWrpmYdbwUzkznw53o5GsTE/v1Q9Uo6Iy8Vp6IIZ e/hw== X-Gm-Message-State: AOAM530j/r8SMSoSK75YC4ZArGSgNPAfodAjVVrzEDshDkTsYVpWOnqB FcdgVG8pYvfqWD9QyH1U5VH3XT1LyuMfXFDV7MmCKWJNwllnNg== X-Google-Smtp-Source: ABdhPJxpkO9eEER/MdmXyf9N77g9mGhdkWxrd1QUx82Y1pC6K2XuLUdmk65dVFt41v98KWT173I1UeBID7jMRSEc4Ps= X-Received: by 2002:a2e:6e02:0:b0:253:d7da:ef27 with SMTP id j2-20020a2e6e02000000b00253d7daef27mr14341104ljc.105.1653382222261; Tue, 24 May 2022 01:50:22 -0700 (PDT) In-Reply-To: <2082AE8E-0195-4408-A32F-2B1C24D66B03@scorecrow.com> 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:115039 Archived-At: --===============3817007459534388256== Content-Type: multipart/alternative; boundary="0000000000000947bb05dfbe0cf8" --0000000000000947bb05dfbe0cf8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, it does! Thanks Bruce. Is this documented somewhere already and I missed it? Cheers. Duncan On Mon, 23 May 2022 at 21:14, Bruce Horrocks wrote: > Does this help? > > \startxmlsetups xml:demo:base > \xmlsetsetup{#1}{tag}{xml:demo:tag} > \xmlsetsetup{#1}{o:tag}{xml:demo:otag} %% <--- > \stopxmlsetups > \xmlregisterdocumentsetup{demo}{xml:demo:base} > \startxmlsetups xml:demo:tag > \xmlflush{#1} > \stopxmlsetups > \startxmlsetups xml:demo:otag %% <--- > {\bf \xmlflush{#1}} > \stopxmlsetups > \starttext > \startbuffer[test] > > xmlns:o=3D"NameSpaceO"> > text text > > \stopbuffer > \xmlprocessbuffer{demo}{test}{} > \stoptext > > > On 23 May 2022, at 09:07, Duncan Hothersall via ntg-context < > ntg-context@ntg.nl> wrote: > > > > I found this unanswered question on the list from November 2020 and fin= d > 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 < > christoph.reller@gmail.com> 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=3D"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 > > > _________________________________________________________________________= __________ > > > > > > > _________________________________________________________________________= __________ > > 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 > > > _________________________________________________________________________= __________ > > =E2=80=94 > Bruce Horrocks > Hampshire, UK > > --0000000000000947bb05dfbe0cf8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, it does! Thanks Bruce. Is this docum= ented somewhere already and I missed it?

Cheers.

Duncan

On Mon, 23 May 2022 at 21:14, Bruce Horrocks = <ntg@scorecrow.com> wrote:
Does this help?
\startxmlsetups xml:demo:base
=C2=A0 \xmlsetsetup{#1}{tag}{xml:demo:tag}
=C2=A0 \xmlsetsetup{#1}{o:tag}{xml:demo:otag} %% <---
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{xml:demo:base}
\startxmlsetups xml:demo:tag
=C2=A0 \xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:demo:otag=C2=A0 =C2=A0%% <---
=C2=A0 {\bf \xmlflush{#1}}
\stopxmlsetups
\starttext
\startbuffer[test]
<?xml version=3D"1.0"?>
<root xmlns=3D"NameSpaceA"
=C2=A0 =C2=A0 =C2=A0 xmlns:o=3D"NameSpaceO">
=C2=A0 <tag>text</tag> <o:tag>text</o:tag>
</root>
\stopbuffer
\xmlprocessbuffer{demo}{test}{}
\stoptext

> On 23 May 2022, at 09:07, Duncan Hothersall via ntg-context <ntg-context@ntg.nl>= ; wrote:
>
> I found this unanswered question on the list from November 2020 and fi= nd today that I have the same question. How can one handle elements with th= e same name but in different namespaces? How should the different \startxml= setups commands be written?
>
> Thanks.
>
> Duncan
>
> On Mon, 16 Nov 2020 at 13:37, Christoph Reller <christoph.reller@gmail.com= > wrote:
> Dear List,
>
> Consider the following MWE:
>
> \startxmlsetups xml:demo:base
>=C2=A0 =C2=A0\xmlsetsetup{#1}{tag}{xml:demo:tag}
> \stopxmlsetups
> \xmlregisterdocumentsetup{demo}{xml:demo:base}
> \startxmlsetups xml:demo:tag
>=C2=A0 =C2=A0%\doif{\xmlnamespace{#1}}{o}{NameSpaceO:}
>=C2=A0 =C2=A0\xmlflush{#1}
> \stopxmlsetups
> \starttext
> \startbuffer[test]
> <?xml version=3D"1.0"?>
> <root xmlns=3D"NameSpaceA"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0xmlns:o=3D"NameSpaceO">
>=C2=A0 =C2=A0<tag>text</tag> <o:tag>text</o:tag>= ;
> </root>
> \stopbuffer
> \xmlprocessbuffer{demo}{test}{}
> \stoptext
>
> My questions:
> - Is there a good way to have a separate XML setup for each XML namesp= ace?
> - Alternatively, one has to do the distinction within the same XML set= up. In this case, how do we get the complete namespace? (In this example: &= quot;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/listin= fo/ntg-context
> webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.ne= t
> archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
> wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
> ______________________________________________________________________= _____________
>
>
> ______________________________________________________________________= _____________
> 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/listin= fo/ntg-context
> webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.ne= t
> archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
> wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
> ______________________________________________________________________= _____________

=E2=80=94
Bruce Horrocks
Hampshire, UK



--0000000000000947bb05dfbe0cf8-- --===============3817007459534388256== 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== --===============3817007459534388256==--