From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/17527 Path: main.gmane.org!not-for-mail From: Richard Gabriel Newsgroups: gmane.comp.tex.context Subject: Re: XML in ConTeXt & verbatim text Date: Wed, 15 Dec 2004 16:43:31 +0100 Message-ID: <41C05BA3.9010507@kerio.com> References: <41BF0B35.4070301@kerio.com> <20041214172728.20974@news.comp.lancs.ac.uk> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1795554851==" X-Trace: sea.gmane.org 1103125394 24240 80.91.229.6 (15 Dec 2004 15:43:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2004 15:43:14 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Dec 15 16:43:06 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CebIw-0006Ig-00 for ; Wed, 15 Dec 2004 16:43:06 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7ED4B127A0; Wed, 15 Dec 2004 16:43:05 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25330-01; Wed, 15 Dec 2004 16:43:00 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0ACE412793; Wed, 15 Dec 2004 16:43:00 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5D42112793 for ; Wed, 15 Dec 2004 16:42:58 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 12844-05 for ; Wed, 15 Dec 2004 16:42:57 +0100 (CET) Original-Received: from mx1.kerio.com (unknown [195.39.55.2]) by ronja.ntg.nl (Postfix) with ESMTP id 79FE112775 for ; Wed, 15 Dec 2004 16:42:57 +0100 (CET) Original-Received: from [192.168.44.160] ([192.168.44.160]) (authenticated user rgabriel@kerio.com) by mx1.kerio.com (Kerio MailServer 6.0.5) for ntg-context@ntg.nl; Wed, 15 Dec 2004 16:42:56 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a4) Gecko/20040926 X-Accept-Language: cs, en-us, en, sk Original-To: mailing list for ConTeXt users In-Reply-To: <20041214172728.20974@news.comp.lancs.ac.uk> X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:17527 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:17527 This is a multi-part message in MIME format. --===============1795554851== Content-Type: multipart/alternative; boundary="------------040409000601090602000108" This is a multi-part message in MIME format. --------------040409000601090602000108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Adam, I did so right now (thanks for the hint!). But in that file ther's only solved a case when each line of the verbatim text is placed in a special tag: Dit \is nogal verbatim ! Dit is {nogal} verbatim ! Dit is verbatim ! This is trivial because you can pass the contents of each element as an argument to the \type command ( \defineXMLargument[line]{\type} ) But this solution is unusable e.g. for longer program or configuration file listings, and, mainly, the DocBook DTD doesn't define such tags. I need to process multiline verbatims enclosed in a single tag: Line 1 Line 2 Line 3 --- Of course I have some "dirty" workaround, but the result is really ugly... \defineXMLenvironment[programlisting]{ \bgroup \startpacked \tttf \obeylines\obeyspaces\obeytabs }{ \stoppacked \egroup } The line breaks are processed correctly. But all the tabs and spaces are treated as a single space. It seems the \obeyspaces and \obeytabs command are ignored or they do not work the way I'd expect. This will totally break the indentation and tabulation of the verbatim text... -Richard Adam Lindsay wrote: >Richard Gabriel said this at Tue, 14 Dec 2004 16:48:05 +0100: > > > >>So I defined a macro to process the tag from the XML file: >>\defineXMLenvironment[programlisting]{\starttyping}{\stoptyping} >> >> > >Richard, > >Have you taken a look at x-contml to see how it solves this problem with >verbatim? > >adam > > --------------040409000601090602000108 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Adam,

I did so right now (thanks for the hint!).
But in that file ther's only solved a case when each line of the verbatim text is placed in a special tag:

<verbatim>
  <line>Dit \is nogal verbatim !</line>
  <line>Dit is {nogal} verbatim !</line>
  <line>Dit is <nogal> verbatim !</line>
</verbatim>

This is trivial because you can pass the contents of each <line> element as an argument to the \type command ( \defineXMLargument[line]{\type} )

But this solution is unusable e.g. for longer program or configuration file listings, and, mainly, the DocBook DTD doesn't define such tags.
I need to process multiline verbatims enclosed in a single tag:

<programlisting>
Line 1
      Line 2
Line 3
</programlisting>

---
Of course I have some "dirty" workaround, but the result is really ugly...

\defineXMLenvironment[programlisting]{
  \bgroup
  \startpacked
  \tttf
  \obeylines\obeyspaces\obeytabs
}{
  \stoppacked
  \egroup
}

The line breaks are processed correctly. But all the tabs and spaces are treated as a single space. It seems the \obeyspaces and \obeytabs command are ignored or they do not work the way I'd expect. This will totally break the indentation and tabulation of the verbatim text...


-Richard





Adam Lindsay wrote:
Richard Gabriel said this at Tue, 14 Dec 2004 16:48:05 +0100:

  
So I defined a macro to process the <programlisting> tag from the XML file:
\defineXMLenvironment[programlisting]{\starttyping}{\stoptyping}
    

Richard, 

Have you taken a look at x-contml to see how it solves this problem with
verbatim?

adam
  
--------------040409000601090602000108-- --===============1795554851== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --===============1795554851==--