From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/5795 Path: main.gmane.org!not-for-mail From: Simon Pepping Newsgroups: gmane.comp.tex.context Subject: Re: Some XML typesetting questions Date: Mon, 8 Oct 2001 22:33:50 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <20011008223350.A763@scaprea> References: <878zemy5d7.fsf@dellius.nederware.nl> <5.1.0.14.1.20011008112132.031f8528@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035396363 4646 80.91.224.250 (23 Oct 2002 18:06:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:06:03 +0000 (UTC) Original-To: ntg-context@ntg.nl In-Reply-To: <5.1.0.14.1.20011008112132.031f8528@server-1>; from pragma@wxs.nl on Mon, Oct 08, 2001 at 11:25:50AM +0200 Xref: main.gmane.org gmane.comp.tex.context:5795 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:5795 Hans, Interesting, this looks like your API for XML programming. How do I go about to understand this? Is there documentation, or should I just work my way through the expansions produced by \tracingcommands=1? Or should I not try to understand this? Simon On Mon, Oct 08, 2001 at 11:25:50AM +0200, Hans Hagen wrote: > \unprotect > > \def\@@XMLescape {\@@XML esc} > > \def\defineXMLescape[#1]#2{\long\setvalue{\@@XMLescape:#1}{#2}} > > \defineXMLescape [--] {\gobbleuntil{-->}} > \defineXMLescape [CDATA] {\skipfirstverbatimlinefalse > \processtaggeddisplayverbatim{]]>}} > \defineXMLescape [\s!default] {\gobbleuntil{>}} > > \def\executeXMLescape#1% > {\executeifdefined{\@@XMLescape:#1}{\getvalue{\@@XMLescape:\s!default}}} > > \protect > > \long\def\xdoXMLelement !#1 % !-- --> or !xyz > > {\endgroup\executeXMLescape{#1}} > > Now, given that you have a file, and a ! handler like: > > \defineXMLescape [DOCTYPE] {\handleXMLescapeDOCTYPE} > \defineXMLescape [ENTITY] {\handleXMLescapeENTITY} > > \def\handleXMLescapeDOCTYPE#1[#2]>% > {#2} > > \def\handleXMLescapeENTITY#1 #2 "#3"#4>% > {\doif{#2}{SYSTEM}{\defineXMLentity[#1]{\readfile{#3}{}{}}}} > > then: > > \defineXMLsingular [test] {WHOW} > \defineXMLsingular [hello] {Hello} > \defineXMLsingular [world] {World} > -- Simon Pepping email: spepping@scaprea.hobby.nl