URLs in XML, escaping special characters
Hi, I'm struggling with getting hyphenated URLs to work from XML input. How do you enter ampersands and percent signs correctly so that they can be used in links? This here doesn't really works: ================ \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} % Hauptgruppen \xmlsetsetup{#1}{article|ext-link}{xml:*} \stopxmlsetups \xmlregistersetup{xml:test} \startxmlsetups xml:article \starttext \xmlflush{#1} \stoptext \stopxmlsetups \startxmlsetups xml:ext-link \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})] \stopxmlsetups \startbuffer[test] <?xml version="1.0" encoding="utf-8" ?> <article> <ext-link ext-link-type="uri" xlink:href="http://merhav.nli.org.il/primo-explore/search?query=any,contains,Glikl&tab=default_tab&search_scope=RAMBI&vid=NLI_Rambi&mfacet=topic,include,Court%20Jews,1&mfacet=topic,include,Glueckel,%20of%20Hameln,%201646-1724,1&lang=en_US&offset=0">http://merhav.nli.org.il/primo-explore/search?query=any,contains,Glikl&t...</ext-link> </article> \stopbuffer \xmlprocessbuffer{test}{test}{} ============= Visual output is ok, but the clickable link contains only the text until the end of the line. Best, Denis
Denis Maier schrieb am 07.10.2020 um 15:42:
Hi,
I'm struggling with getting hyphenated URLs to work from XML input. How do you enter ampersands and percent signs correctly so that they can be used in links?
This here doesn't really works:
================ \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} % Hauptgruppen \xmlsetsetup{#1}{article|ext-link}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:test}
\startxmlsetups xml:article \starttext \xmlflush{#1} \stoptext \stopxmlsetups
\startxmlsetups xml:ext-link \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})] \stopxmlsetups
\startxmlsetups xml:ext-link \begingroup \expandUx \expanded{\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]} \endgroup \stopxmlsetups Wolfgang
Am 07.10.2020 um 16:47 schrieb Wolfgang Schuster:
Denis Maier schrieb am 07.10.2020 um 15:42:
Hi,
I'm struggling with getting hyphenated URLs to work from XML input. How do you enter ampersands and percent signs correctly so that they can be used in links?
This here doesn't really works:
================ \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} % Hauptgruppen \xmlsetsetup{#1}{article|ext-link}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:test}
\startxmlsetups xml:article \starttext \xmlflush{#1} \stoptext \stopxmlsetups
\startxmlsetups xml:ext-link \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})] \stopxmlsetups
\startxmlsetups xml:ext-link \begingroup \expandUx \expanded{\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]} \endgroup \stopxmlsetups
Wolfgang
Thanks, Wolfgang. Unfortunately, the clickable link is still not correct. What am I doing wrong? Best, Denis
Denis Maier schrieb am 07.10.2020 um 17:16:
Am 07.10.2020 um 16:47 schrieb Wolfgang Schuster:
Denis Maier schrieb am 07.10.2020 um 15:42:
Hi,
I'm struggling with getting hyphenated URLs to work from XML input. How do you enter ampersands and percent signs correctly so that they can be used in links?
This here doesn't really works:
================ \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} % Hauptgruppen \xmlsetsetup{#1}{article|ext-link}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:test}
\startxmlsetups xml:article \starttext \xmlflush{#1} \stoptext \stopxmlsetups
\startxmlsetups xml:ext-link \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})] \stopxmlsetups
\startxmlsetups xml:ext-link \begingroup \expandUx \expanded{\goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlflush{#1})]} \endgroup \stopxmlsetups
Wolfgang
Thanks, Wolfgang.
Unfortunately, the clickable link is still not correct. What am I doing wrong?
Add \setupinteraction[state=start] to your document. Wolfgang
Am 07.10.2020 um 17:19 schrieb Wolfgang Schuster:
Denis Maier schrieb am 07.10.2020 um 17:16:
Am 07.10.2020 um 16:47 schrieb Wolfgang Schuster:
Denis Maier schrieb am 07.10.2020 um 15:42: [...]
Unfortunately, the clickable link is still not correct. What am I doing wrong?
Add
\setupinteraction[state=start]
to your document.
Ouch... I have that in my real document, but forgot to include it in my MWE. Thanks. Denis
participants (2)
-
Denis Maier
-
Wolfgang Schuster