[NTG-context] XML in ConTeXt & verbatim text

Richard Gabriel rgabriel at kerio.com
Thu Dec 16 16:36:07 CET 2004


Hello Hans,

thank you very much for the advice. It works almost perfectly, except 
one small (but important) detail:
Let's have a HTML source code in the <programlisting> tag. It will be 
stored the following way in the XML file:
<programlisting>
&lt;html&gt;
&lt;body&gt;
&lt;p&gt;Some text&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</programlisting>

I have defined the entity conversion:
\defineXMLentity[gt]{\char`\>{}}
\defineXMLentity[lt]{\char`\<{}}

This works OK if the entities occur somewhere in the normal text but it 
doesn't matter in the verbatim text.
Is there any solution for this? Maybe changing catcodes of the & and ; 
characters?

Thanks again...

Richard





Hans Hagen wrote:

> Richard Gabriel wrote:
>
> maybe the following is better
>
> \defineXMLenvironment
>   [programlisting]
>   {\processtaggeddisplayverbatim{</programlisting>}}
>   {}
>
> \startbuffer
> <programlisting>
> Line 1
>       Line 2
> Line 3
> </programlisting>
> \stopbuffer
>
> \starttext
>
> \processXMLbuffer
>
> \stoptext
>
> -----------------------------------------------------------------
>                                           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
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context at ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context




More information about the ntg-context mailing list