From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113256 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Denis Maier via ntg-context Newsgroups: gmane.comp.tex.context Subject: XML-processing: Error with hyphenatedurl Date: Wed, 27 Oct 2021 13:03:24 +0000 Message-ID: <738bff13fcc84eb7801abe0ef0f317d8@unibe.ch> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7024519639514774209==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2142"; mail-complaints-to="usenet@ciao.gmane.io" Cc: denis.maier@unibe.ch To: Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 27 15:04:24 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 1mfibP-0000NG-Q7 for gctc-ntg-context-518@m.gmane-mx.org; Wed, 27 Oct 2021 15:04:23 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 26C8F267F0F; Wed, 27 Oct 2021 15:03:43 +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 pkrpy7jqgwV8; Wed, 27 Oct 2021 15:03:41 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0AD29267F06; Wed, 27 Oct 2021 15:03:41 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 84DFE267F05 for ; Wed, 27 Oct 2021 15:03:39 +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 dwIZT-PcM4PO for ; Wed, 27 Oct 2021 15:03:37 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=130.92.0.83; helo=mailhub-lb2.unibe.ch; envelope-from=denis.maier@unibe.ch; receiver= Original-Received: from mailhub-lb2.unibe.ch (mailhub-lb2.unibe.ch [130.92.0.83]) (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 D701D267EA6 for ; Wed, 27 Oct 2021 15:03:37 +0200 (CEST) X-Virus-Scanned: By University of Bern - MGW Original-Received: from mail.campus.unibe.ch (aai-edge-01.campus.unibe.ch [130.92.13.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailhub-lb2.unibe.ch (Postfix) with ESMTPS id D91735002B4 for ; Wed, 27 Oct 2021 15:03:24 +0200 (CEST) Thread-Topic: XML-processing: Error with hyphenatedurl Thread-Index: AdfLMamfYg2H+xhFQSirRaP9bFpfig== Accept-Language: de-CH, en-US Content-Language: de-DE x-originating-ip: [130.92.13.161] 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:113256 Archived-At: --===============7024519639514774209== Content-Language: de-DE Content-Type: multipart/alternative; boundary="_000_738bff13fcc84eb7801abe0ef0f317d8unibech_" --_000_738bff13fcc84eb7801abe0ef0f317d8unibech_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I've receiving errors that seem to be related to hyphenatedurl. The problem= is I cannot really reproduce it in a MWE. The example below works, but if = I include the link in my real document, I'am getting this error message (co= pied from -error.log): %%%%%%%%%%%%%%%%%%%%% return { ["errortype"]=3D1, ["filename"]=3D"", ["lastcontext"]=3D"\n \n \n \\xdef \n<= macro> \\expanded \n #1->\\xdef \n \\m_= syst_helpers_expanded {\\noexpand #1}\\m_sy= st_helpers_expanded \n \\22>:xml:ext-link= \n #1->\\begingroup \\expandUx \\ex= panded \n {\\goto {\\hyphenatedurl {\\xmlflush {#1}}}[u= rl(\\xmlflush {#1})]}\\endgroup \n \n \= \22>:xml:p \n #1->\\begingroup \\= xmlfilter {#1}{.[@xml:lang]/command(xml:language)}\\xmlfl= ush {#1}\n \\endgroup \\par \n = \n ...\n\n \n \n\n", ["lastluaerror"]=3D"", ["lasttexerror"]=3D"Missing number, treated as zero", ["lasttexhelp"]=3D"A number should have been here; I inserted '0'. (If you = can't figure out why I\nneeded to see a number, look up 'weird error' in th= e index to The TeXbook.)", ["linenumber"]=3D9, ["offset"]=3D10, ["skiplinenumber"]=3D5, } %%%%%%%%%%%%%%%%%%%% Two things seemed to make it work: 1. Remove the link. 2. Comment out \expandUx in this setup: %%%%%%%%%%%%%%%%%%%% \startxmlsetups xml:ext-link \begingroup \expandUx % commenting this out makes it work \expanded{\goto{\hyphenatedurl{\xmlflush{#1}= }}[url(\xmlflush{#1})]} \endgroup \stopxmlsetups %%%%%%%%%%%%%%%%%%%% Best, Denis %%%%%%%%%%%%%%%%%%%%%%%%%%%% \setupinteraction[state=3Dstart] \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{article|ext-link}{xml:*} \stopxmlsetups \xmlregistersetup{xml:test} \startxmlsetups xml:article \starttext \xmlflush{#1} \stoptext \stopxmlsetups \startxmlsetups xml:ext-link \begingroup \expandUx \expanded{\goto{\hyphenatedurl{\xmlflush{#1}= }}[url(\xmlflush{#1})]} \endgroup \stopxmlsetups \startbuffer[test]
asdf asdf
\stopbuffer \xmlprocessbuffer{test}{test}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --_000_738bff13fcc84eb7801abe0ef0f317d8unibech_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I’ve receiving errors that seem to be related = to hyphenatedurl. The problem is I cannot really reproduce it in a MWE. The= example below works, but if I include the link in my real document, I̵= 7;am getting this error message (copied from -error.log):

 

%%%%%%%%%%%%%%%%%%%%%

return {

["errortype"]=3D1,

["filename"]=3D"",

["lastcontext"]=3D"\n<to be read a= gain> \n    \n    \\xdef \n<macro> \\expanded \n&nb= sp;   #1->\\xdef \n  &nb= sp; \\m_syst_helpers_expanded {\= \noexpand #1}\\m_syst_helpers_expanded \n<macro> \\22>:xml:ext-link \n &nb= sp;  #1->\\begingroup \\expandUx \\ex= panded \n    {\\goto {\\hyphenatedurl {\\xmlflush {#1}}}= [url(\\xmlflush {#1})]}\\endgroup \n<lua= output> \n<macro> \\22>:xml:p \n    #1-&= gt;\\begingroup \\xmlfilter {#1}{.[@xml:lang]/command(xml:= language)}\\xmlflush {#1}\n    \\endgroup \\par= \n<lua output> \n ...\n\n<initial> \n    \n\n&q= uot;,

["lastluaerror"]=3D"",

["lasttexerror"]=3D"Missing number, t= reated as zero",

["lasttexhelp"]=3D"A number should ha= ve been here; I inserted '0'. (If you can't figure out why I\nneeded to see= a number, look up 'weird error' in the index to The TeXbook.)",<= /o:p>

["linenumber"]=3D9,

["offset"]=3D10,

["skiplinenumber"]=3D5,

}

%%%%%%%%%%%%%%%%%%%%

 

Two things seemed to make it work:

1. Remove the link.

2. Comment out \expandUx in thi= s setup:

 

%%%%%%%%%%%%%%%%%%%%=

\startxmlsetups xml:ext-link

    \begingroup<= o:p>

     &= nbsp;  \expandUx % commenting this out makes it work=

     &= nbsp;           &nbs= p;             = \expanded{\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]}

    \endgroup

\stopxmlsetups

%%%%%%%%%%%%%%%%%%%%=

 

 

Best,

Denis

 

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setupinteraction[state=3Dstart]

 

\startxmlsetups xml:test

    \xmlsetsetup{#1}{*}{-}=

    \xmlsetsetup{#1}{article|ext-link= }{xml:*}

\stopxmlsetups

 

\xmlregistersetup{xml:test}

 

\startxmlsetups xml:article

\starttext

    \xmlflush{#1}

\stoptext

\stopxmlsetups

 

\startxmlsetups xml:ext-link

    \begingroup

        \expandUx=

        &nbs= p;            &= nbsp;         \expanded{\goto{\hyph= enatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]}

    \endgroup

\stopxmlsetups

 

\startbuffer[test]

<?xml version=3D"1.0&qu= ot; encoding=3D"utf-8" ?>

<article>

 

asdf

 

<ext-link ext-link-type=3D"uri" xlink:h= ref=3D"asdf">asdf</ext-link>

 

</article>

\stopbuffer

 

\xmlprocessbuffer{test}{test}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

--_000_738bff13fcc84eb7801abe0ef0f317d8unibech_-- --===============7024519639514774209== 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== --===============7024519639514774209==--