From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6248 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: xml comments Date: Tue, 27 Nov 2001 10:43:54 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20011127104108.02f06868@server-1> References: <5.1.0.14.1.20011126160618.03f57fe0@server-1> <200111261420.fAQEK8v07913@sol.cs.uni-dortmund.de> <5.1.0.14.1.20011126160618.03f57fe0@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035396786 8860 80.91.224.250 (23 Oct 2002 18:13:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:13:06 +0000 (UTC) Cc: gundlach@irb.cs.uni-dortmund.de, ntg-context@ntg.nl Original-To: Taco Hoekwater In-Reply-To: <20011127093741.6f948a32.taco@elvenkind.com> Xref: main.gmane.org gmane.comp.tex.context:6248 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6248 At 09:37 AM 11/27/2001 +0100, Taco Hoekwater wrote: >"Hans Hagen" wrote: > > At 03:20 PM 11/26/2001 +0100, Patrick Gundlach wrote: > > >Hi, > > > > > >xml comments have a bug (!?): spaces are critical at the > > >beginning of a comment. > > > > you may try (and play with): > > > > \long\def\xparseXMLescape !#1#2#3{\parseXMLescape{#1#2}#3} > >Adding #3 is safe, sort of. keywords, and is a valid comment (although very unlikely to appear). > >The string "" is actually a comment that starts with >a space. The comment itself in this case is: " crap ". > >It is possible to take advantage of the fact that '{} > >\def\doxparseXMLescape#1 {\parseXMLescape{#1}} yesterday i found out that i needed both alternatives , so i came up with: \long\def\xparseXMLescape !#1#2% {\if#1-% \if#2-% \expandafter\expandafter\expandafter\xxparseXMLescape \else \expandafter\expandafter\expandafter\xyparseXMLescape \fi \else \expandafter\xyparseXMLescape \fi#1#2} \long\def\xxparseXMLescape --#1{\parseXMLescape{--}#1} \long\def\xyparseXMLescape #1 {\parseXMLescape{#1}} so far this one works ok. indeed, if we assume that #1 and #1 are the same and -, we can have a faster alternative, but we may want to play safe. How does this keyword mechanism work? Are there only officially registered ones? Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------