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

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).