ConTeXt has a list of predefined entities like & which can be used without the use of \xmlsetentity.

Wolfgang
dr. Hans van der Meer
3. April 2018 um 16:22
Does ConText always process DOCTYPE definitions? Because in the next example the defined XXX entity is substituted in one case but not in the other.

In a directory I have the following files:

doctype.tex =
\startxmlsetups demo:setups
\xmlsetsetup{#1}{root}{demo:*}
\stopxmlsetups
\xmlregistersetup{demo}{demo:setups}
\startxmlsetups demo:root
\xmlflush{#1}
\stopxmlsetups
\startbuffer[demo]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Entities [<!ENTITY XXX "My xxx definition">]>
<root>
See &amp;XXX; for &XXX;.
</root>
\stopbuffer
\starttext
\xmlprocessbuffer{demo}{demo}{}
\stoptext

Produces as output a subtituted entity


But

doctype-public.tex = 
\startxmlsetups demo:setups
\xmlsetsetup{#1}{root}{demo:*}
\stopxmlsetups
\xmlregistersetup{demo}{demo:setups}
\startxmlsetups demo:root
\xmlflush{#1}
\stopxmlsetups
\startbuffer[demo]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Entities PUBLIC "namen.dtd" "file://namen.dtd"><root>
See &amp;XXX; for &XXX;.
</root>
\stopbuffer
\starttext
\xmlprocessbuffer{demo}{demo}{}
\stoptext

namen.dtd = 
<!ENTITY XXX "This is my XXX definition">

The last two do not output a substituted entity. Why is this not working? What I am doing wrong?



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
___________________________________________________________________________________