ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Richard Gabriel <rgabriel@kerio.com>
Subject: Re: XML in ConTeXt & verbatim text
Date: Thu, 16 Dec 2004 16:36:07 +0100	[thread overview]
Message-ID: <41C1AB67.2010400@kerio.com> (raw)
In-Reply-To: <41C06CE7.7040702@wxs.nl>

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@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

  reply	other threads:[~2004-12-16 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14 15:48 Richard Gabriel
2004-12-14 17:27 ` Adam Lindsay
2004-12-15 15:43   ` Richard Gabriel
2004-12-15 16:57     ` Hans Hagen
2004-12-16 15:36       ` Richard Gabriel [this message]
2004-12-16 16:02         ` Hans Hagen
2004-12-17  7:50           ` Richard Gabriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41C1AB67.2010400@kerio.com \
    --to=rgabriel@kerio.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).