From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36885 Path: news.gmane.org!not-for-mail From: "Richard Gabriel" Newsgroups: gmane.comp.tex.context Subject: Re: Problem with XML entities in titles [2] Date: Thu, 04 Oct 2007 16:36:02 +0200 Message-ID: <20071004143602.e0c0f0f6@mx1.kerio.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1641285433==" X-Trace: sea.gmane.org 1191508670 32274 80.91.229.12 (4 Oct 2007 14:37:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 4 Oct 2007 14:37:50 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 04 16:37:46 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1IdRpg-0003ix-Gc for gctc-ntg-context-518@m.gmane.org; Thu, 04 Oct 2007 16:37:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 510951FD51; Thu, 4 Oct 2007 16:37:38 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14157-05-3; Thu, 4 Oct 2007 16:37:04 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E8E941FD26; Thu, 4 Oct 2007 16:37:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 364301FCC7 for ; Thu, 4 Oct 2007 16:36:50 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14157-05-2 for ; Thu, 4 Oct 2007 16:36:05 +0200 (CEST) Original-Received: from mx1.kerio.com (mx1.kerio.com [195.39.55.2]) by ronja.ntg.nl (Postfix) with ESMTP id 2DAAC1FD26 for ; Thu, 4 Oct 2007 16:36:03 +0200 (CEST) Original-Received: from localhost ([127.0.0.1]) by mx1.kerio.com for ntg-context@ntg.nl; Thu, 4 Oct 2007 16:36:03 +0200 In-Reply-To: 115224fb0710040447h6e23e9e6h4b79b3dd0e1df14f@mail.gmail.com X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:36885 Archived-At: This is a multi-part message in MIME format. --===============1641285433== Content-Type: multipart/alternative; boundary="-----------cd4981409356ef25651c3cb672b2e869" This is a multi-part message in MIME format. -------------cd4981409356ef25651c3cb672b2e869 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello once again, I've puzzled my brain for a while ;-) and then I came to the following solution: \def\ExChapter#1{ \expanded{\chapter{#1}} } \defineXMLcommand[chapter]{ \defineXMLargument[title]\ExChapter } >>From the first tests, it seems to work fine, anyway, I'm not sure if it = won't break anything else... :-/ Anyway, thank for your hint with the expansion! -Richard =5F=5F=5F=5F=5F =20 From: Wolfgang Schuster [mailto:schuster.wolfgang@googlemail.com] To: mailing list for ConTeXt users [mailto:ntg-context@ntg.nl] Sent: Thu, 04 Oct 2007 13:47:27 +0200 Subject: Re: [NTG-context] Problem with XML entities in titles [2] 2007/10/4, Richard Gabriel : > Hello Hans, > > some time ago I've reported this problem with character entities. I'= ve just > upgraded to ConTeXt 2007-09-28, and the problem still persists! > Could you please look into it=3F A simple test file is attached. > > Many thanks, > Richard =20 Hello Richard, =20 I'm not Hans but I can also give you a solution to your problem. =20 This is related to your own definition for the chapter header and ConTeXt's mechanism to save the two pass information of the headers, you should save the header text and expand the header command with the header text, you can use my example for your problem. =20 BTW: Your xml file is valied because you forgot to include the chapter end tag. =20 \defineXMLenvironment [chapter] {\defineXMLsave[title]} {\expanded{\chapter{\XMLflush{title}}}} =20 \defineXMLenvironment[para] \dontleavehmode \par =20 \defineXMLentities [tex] {tex} {\TeX} =20 \starttext \completecontent =20 \startXMLdata This is a testing &tex; chapter Some meaningless text... \stopXMLdata =20 \stoptext =20 Wolfgang =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F If your question is of interest to others as well, please add an entry= to the Wiki! =20 maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg= -context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F =20 -------------cd4981409356ef25651c3cb672b2e869 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello once again,

I've puzzled my brain for a while ;-)
and th= en I came to the following solution:

\def\ExChapter#1{
  = \expanded{\chapter{#1}}
}

\defineXMLcommand[chapter]{
 = ; \defineXMLargument[title]\ExChapter
}

From the first tests, = it seems to work fine, anyway, I'm not sure if it won't break anything e= lse... :-/
Anyway, thank for your hint with the expansion!

-Ri= chard




From: Wolfgang Schuster [mailto:schuster.wolfgang@googlemail.com]To: mailing list for ConTeXt users [mailto:ntg-context@ntg.nl]<= br>Sent: Thu, 04 Oct 2007 13:47:27 +0200
Subject: Re: [= NTG-context] Problem with XML entities in titles [2]

2007/10/4, R= ichard Gabriel <rgabriel@kerio.= com>:
> Hello Hans,
>
> some time ago I've reported this problem with character entities. I= 've just
> upgraded to ConTeXt 2007-09-28, and the problem still persists!
> Could you please look into it=3F A simple test file is attached. >
> Many thanks,
> Richard

Hello Richard,

I'm not Hans but I can also give you a solution to your problem.

This is related to your own definition for the chapter header and
ConTeXt's mechanism to save the two pass information of the headers,
you should save the header text and expand the header command
with the header text, you can use my example for your problem.

BTW: Your xml file is valied because you forgot to include the
chapter end tag.

\defineXMLenvironment [chapter]
{\defineXMLsave[title]}
{\expanded{\chapter{\XMLflush{title}}}}

\defineXMLenvironment[para] \dontleavehmode \par

\defineXMLentities [tex] {tex} {\TeX}

\starttext
\completecontent

\startXMLdata
<chapter><title>This is a testing &tex; chapter</titl= e></chapter>
<para>Some meaningless text...</para>
\stopXMLdata

\stoptext

Wolfgang
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
If your question is of interest to others as well, please add an entry t= o the Wiki!

maillist : ntg-context@ntg.nl = / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http= ://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http= ://contextgarden.net
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
-------------cd4981409356ef25651c3cb672b2e869-- --===============1641285433== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1641285433==--