ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* URLs in XML, escaping special characters
@ 2020-10-07 13:42 Denis Maier
  2020-10-07 14:47 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Maier @ 2020-10-07 13:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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&amp;tab=default_tab&amp;search_scope=RAMBI&amp;vid=NLI_Rambi&amp;mfacet=topic,include,Court%20Jews,1&amp;mfacet=topic,include,Glueckel,%20of%20Hameln,%201646-1724,1&amp;lang=en_US&amp;offset=0">http://merhav.nli.org.il/primo-explore/search?query=any,contains,Glikl&amp;tab=default_tab&amp;search_scope=RAMBI&amp;vid=NLI_Rambi&amp;mfacet=topic,include,Court%20Jews,1&amp;mfacet=topic,include,Glueckel,%20of%20Hameln,%201646-1724,1&amp;lang=en_US&amp;offset=0</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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: URLs in XML, escaping special characters
  2020-10-07 13:42 URLs in XML, escaping special characters Denis Maier
@ 2020-10-07 14:47 ` Wolfgang Schuster
  2020-10-07 15:16   ` Denis Maier
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2020-10-07 14:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: URLs in XML, escaping special characters
  2020-10-07 14:47 ` Wolfgang Schuster
@ 2020-10-07 15:16   ` Denis Maier
  2020-10-07 15:19     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Maier @ 2020-10-07 15:16 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users

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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: URLs in XML, escaping special characters
  2020-10-07 15:16   ` Denis Maier
@ 2020-10-07 15:19     ` Wolfgang Schuster
  2020-10-07 15:34       ` Denis Maier
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2020-10-07 15:19 UTC (permalink / raw)
  To: Denis Maier; +Cc: mailing list for ConTeXt users

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: URLs in XML, escaping special characters
  2020-10-07 15:19     ` Wolfgang Schuster
@ 2020-10-07 15:34       ` Denis Maier
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Maier @ 2020-10-07 15:34 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-07 15:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 13:42 URLs in XML, escaping special characters Denis Maier
2020-10-07 14:47 ` Wolfgang Schuster
2020-10-07 15:16   ` Denis Maier
2020-10-07 15:19     ` Wolfgang Schuster
2020-10-07 15:34       ` Denis Maier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).