-----Ursprüngliche Nachricht----- Von: Maier, Denis Christian (UB) Gesendet: Mittwoch, 27. Oktober 2021 16:31 An: 'mailing list for ConTeXt users'
Cc: Pablo Rodriguez Betreff: AW: [NTG-context] XML-processing: Error with hyphenatedurl -----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Pablo Rodriguez via ntg-context Gesendet: Mittwoch, 27. Oktober 2021 15:43 An: Denis Maier via ntg-context Cc: Pablo Rodriguez Betreff: Re: [NTG-context] XML-processing: Error with hyphenatedurl On 10/27/21 3:03 PM, Denis Maier via ntg-context wrote:
[...] 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 (copied from -error.log): [...] Two things seemed to make it work: 1. Remove the link. 2. Comment out \expandUx in this setup:
Hi Denis,
in my environments to typeset XML sources, I never need \expandUx, why do you needit?
I've had a problem with special characters in URLs. Wolfgang suggested to use \expandUx: https://www.mail-archive.com/ntg-context@ntg.nl/msg95959.html
Another approach (I don’t know whether this will work in your real-world document) might be using \xmlpure instead of \xmlflush as in:
\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlpure{#1})]
That works. Thank you.
Oh, actually that leads to a similar problem as in my original question where Wolfgang suggested using \expandUx: if the URL is broken across lines, the link content is also broken. Interestingly, the plain \startxmlsetups xml:ext-link-var-var \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})] \stopxmlsetups seems to work now correctly. Best, Denis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \setuppapersize[A6] \setupinteraction[state=start] \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{article|ext-link|ext-link-var|ext-link-var-var}{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 \startxmlsetups xml:ext-link-var \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlpure{#1})] \stopxmlsetups \startxmlsetups xml:ext-link-var-var \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})] \stopxmlsetups \startbuffer[test] <?xml version="1.0" encoding="utf-8" ?> <article> asdfasdf asdkflöasj asdf <ext-link ext-link-type="uri" xlink:href="asdf">https://wiki.contextgarden.net/Main_Page</ext-link> asdfasdf asdkflöasj asdf <ext-link-var ext-link-type="uri" xlink:href="asdf">https://wiki.contextgarden.net/Main_Page</ext-link-var> asdfasdf asdkflöasj asdf <ext-link-var-var ext-link-type="uri" xlink:href="asdf">https://wiki.contextgarden.net/Main_Page</ext-link-var-var> </article> \stopbuffer \xmlprocessbuffer{test}{test}{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%