[NTG-context] xml entities and trailing space

Hans Hagen pragma at wxs.nl
Tue Feb 9 18:50:23 CET 2010


On 7-2-2010 22:19, Thomas A. Schmitz wrote:
> \startbuffer[xmltest]
> <p>A&textbar; B</p>
> \stopbuffer
>
> \startxmlsetups xml:mysetups
>      \xmlsetsetup{\xmldocument}{p}{xml:*}
> \stopxmlsetups
>
> \xmlregistersetup{xml:mysetups}
>
> \startxmlsetups xml:p
>      \xmlflush{#1} \par
> \stopxmlsetups
>
> \xmlsetentity{textbar}{\textbar}
>
> \starttext
> \xmlprocessbuffer{main}{xmltest}{}
> \stoptext

this is not that easy as effectively

A&textbar; B

becomes

A\textbar B

and tex will normally gobble that space as part of parsing the input and 
changing that aspect will not happen

chicken or egg so use:

\xmlsetentity{textbar}{\textbar{}}


Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list