On 19 Apr 2018, at 14:44, Hans Hagen <j.hagen@xs4all.nl> wrote:On 4/19/2018 10:53 AM, Hans van der Meer wrote:The following use of character entities & aborts in ConTeXt. That is of course because the # is seen as a parameter. Changing this to &\#xxx; or &\letterhash xxx; typesets & as is, but that is not the intention, because an ampersand should appear. So, how do I proceed here?
Minimal example:
% test character entity failure.
\startxmlsetups demo:entity
\xmlsetsetup{#1}{root}{demo:entity:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{demo:entity}
\startxmlsetups demo:entity:root
\blank Start test:\crlf
root: <amp> = "&"\crlf
root: <number> = "&\letterhash 038;”\crlf % &\#038; produces the same
End test\blank
\stopxmlsetups
you are tex mode there so & == &\startbuffer[demo]
<root></root>
\stopbuffer
\starttext
\currentdate-\currenttime\quad\ConTeXt-version=\contextversion\blank
{\bf Testing use of character entities}\blank
These should produce the same result: \type{&} and \type{&}\blank
\xmlprocessbuffer{demo}{demo}{}\blank
\stoptext
dr. Hans van der Meer
___________________________________________________________________________________
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
___________________________________________________________________________________
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------