From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21253 invoked from network); 27 Aug 2023 11:54:49 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 27 Aug 2023 11:54:49 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3F1E2482CB7 for ; Sun, 27 Aug 2023 13:53:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q16B4BERI6m4 for ; Sun, 27 Aug 2023 13:53:10 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3DFEC482C92 for ; Sun, 27 Aug 2023 13:52:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3011648242E for ; Sun, 27 Aug 2023 13:52:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pnCnrgfqVMFT for ; Sun, 27 Aug 2023 13:52:08 +0200 (CEST) Received: from outbound.soverin.net (outbound.soverin.net [185.233.34.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id CCD09482428 for ; Sun, 27 Aug 2023 13:52:08 +0200 (CEST) Received: from smtp.freedom.nl (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4RYX9N5HV5z4y for ; Sun, 27 Aug 2023 11:52:08 +0000 (UTC) Received: from smtp.freedom.nl (smtp.freedom.nl [10.10.4.107]) by freedom.nl (Postfix) with ESMTPSA id 4RYX9N0wk8z6N for ; Sun, 27 Aug 2023 11:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freedom.nl; s=default; t=1693137128; bh=fznDbYcgHEOMfuBfXA0edqvs3TsMey9SBi5BSeDZ3xM=; h=Date:Subject:To:References:From:In-Reply-To:From; b=T3j8+/mX0dpkgQtRdF4693IqKpkKdQWf2pO0/o4IsK+l37haOStsdh7xe69kBHP0r Fq1+toaALlxiLQrS6vsIUgq/FvW9jM2bD29aG3or9SDOA4QaF20lLs8cfUwPcRIQpX en7T/JjP8CaT5qyZ7pk/HZAY8fj1yzmoPe8qoMu8= ARC-Seal: i=1; s=default; d=freedom.nl; t=1693137128; a=rsa-sha256; cv=none; b=gv1uiSAPWQMtDQPtSuR4dfgafuhJyASjCBVLiGdNlMilny9yoiAkk1lfaSQysQWDGnhBTI 3xV5+zKoBB0nxIs8FNmEaRDJPWg+2oqC/3m7AC9Eq32Z1TFEOk5oEqSOl0OIQcgdPAqyDg gf5TSxy5L0NeODtm/60g4qfR2+GpM2I= ARC-Authentication-Results: i=1; smtp.freedom.nl; auth=pass smtp.mailfrom=j.hagen@freedom.nl ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freedom.nl; s=default; t=1693137128; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXhRsfAZyeejrQC3/lxU23xQ21qG2RlNnd32J//QHYo=; b=rg99K8fvYwVKCsWck2MkxmtjdKz/UznvDhGO3LG+Hd1Ya2WATVkPnYyrF8X8J+YwqSNJG6 Mds6VO+Js5VwRYajdQg9cqCB3ypCgC6zl8tZNXSZEDMor3o3jTgL896WFxSLVK9TbOedvO suK/gJdg16rO5DiB0r0BYOTmmjnjwHE= Message-ID: Date: Sun, 27 Aug 2023 13:52:07 +0200 MIME-Version: 1.0 Content-Language: en-US To: ntg-context@ntg.nl References: X-Soverin-Authenticated: true In-Reply-To: Message-ID-Hash: V3KJ7S4GZ3IQ5IKZHGMT5MSBOLWEIVXL X-Message-ID-Hash: V3KJ7S4GZ3IQ5IKZHGMT5MSBOLWEIVXL X-MailFrom: j.hagen@freedom.nl X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: XML: Correct usage of hash symbol in url / new upload List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Hans Hagen via ntg-context Cc: Hans Hagen Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit Hi Denis, > I need to process URLs in XML documents differently depending on the target. Thanks to Hans and Thomas I can now deal with the attributes. > Now I need to prefix certain kind of targets with a certain URL (a web viewer for IIIF images in this particular case). The prefix contains a #, which, as a special character seems to cause an error. Adding a double hash seems to work, but those ## will end up in the link URL. How can I properly escape a single #? I've already tried using \Ux{23}, but that won't work either. The duplication of hashes is kind of special. Consider this: \def\foo#1{#1 test ##} \def\foo#1{#1 test\def\more##1{(##1)}} the internal representation of #1 is a reference to parameter 1 while the ## becomes one # (cc parameter) in the second exmaple followed by a character 1 (cc other) then, when tex serializes e.g. in tracing it duplicates the hash (with cc parameter) so that the user is not confused (an alternative could have been to indicate a parameter reference differently but changing that now is no real option - what symbol to use anyway?) with lua(meta)tex opening up matters this duplication becomes a bit annoying so i decided to see if it could be avoided in some cases first i decided to provide an escape, possible because we already have such mechanism using # (not advertised because it is still experimental) then i decided to just not duplicate unless we trace in the lowlevel macro manual there is a section added that goes in more detail to come back to the escaping: here is a list: #I loop iteraor #P parent loop iterator #G grandparent loop iterator #H hash #S space (ascii 32) #T tab \t #L newline \n #R return \r #X backslash considering #N nbsp and some more. Keep in mind that #1-#9 #A-#E are in use as parameter references but in the case of your url's escaping should not be needed (hopefully) Hans ps. all kind of expereimental because it's a bit hairy and we don't want to loose compatibility (hashes get interpreted in the macro preamble, macro body, running text, serialization etc) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________